diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..84ed7fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,92 @@ +name: Bug report +description: Report a bug in APK Tool GUI +labels: bug +body: + - type: checkboxes + attributes: + label: Prerequisites + description: To rule out invalid issues, confirm and check each one of the checkboxes. + options: + - label: This is not a support issue or a question. For support, questions, or help, see [support links](https://github.com/AndnixSH/APKToolGUI/issues/new/choose). + required: true + - label: I performed a cursory search of the issue tracker on [APK Tool GUI](https://github.com/AndnixSH/APKToolGUI/issues?q=is%3Aissue) to avoid opening a duplicate issue + required: true + - label: I am running the latest version of [APK Tool GUI](https://github.com/AndnixSH/APKToolGUI/releases). + required: true + - label: I have read the [FAQ](https://github.com/AndnixSH/APKToolGUI#faq) + required: true + + - type: textarea + attributes: + label: Describe the bug + description: | + A clear and concise description of what the bug is. + Feel free to upload/attach link to screenshot or video + Only place logs in 'Logs' box + validations: + required: true + + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior + validations: + required: true + + - type: textarea + attributes: + label: Logs + description: Please surround the logs with 3 backticks (```) to format it properly + placeholder: | + Copy and paste the logs here + + This is an example how you should surround the logs with 3 backticks (```) + ``` + [12:50:54]java version "19.0.2" 2023-01-17 + Java(TM) SE Runtime Environment (build 19.0.2+7-44) + Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing) + [12:50:55] Apktool version "2.7.0" + [12:50:55] Drag & drop is supported + [12:50:55] Temp directory: "D:\Temp\ATG\xeaMO" + [12:50:55] Parsing APK Info... + [12:50:55] Done + [12:50:55] Getting devices... + [12:50:57] No devices found. Make sure your device is connected to the computer with the adb debugging turned on. If you use an emulator, restart it and wait until it boot up + ``` + validations: + required: true + + - type: textarea + attributes: + label: APK + description: If this APK can be freely shared, please upload/attach a link to it. Please warn with "NSFW" where applicable, if the APK or the link contains adult content + placeholder: | + https://apkcombo.com/downloader/ + validations: + required: false + + - type: input + attributes: + label: APK Tool GUI version + validations: + required: true + + - type: input + attributes: + label: Apktool version + validations: + required: true + + - type: input + attributes: + label: Java version + validations: + required: true + + - type: input + attributes: + label: Operating system and version + placeholder: | + (Example: Windows 11 2h22) + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..18cd9c7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,17 @@ +blank_issues_enabled: false +contact_links: + - name: Apktool Issues List + url: https://github.com/iBotPeaches/Apktool/issues?q=is%3Aissue + about: Check Apktool issues before reporting issue here. Your issue might already exists + - name: Apktool forum + url: https://github.com/iBotPeaches/Apktool/discussions + about: For support, questions or help with Apktool, development and modding + - name: Smali Issues List + url: https://github.com/JesusFreke/smali/issues?q=is%3Aissue + about: Check Baksmali issues before reporting issue here. Your issue might already exists + - name: Smali Issues List 2 + url: https://github.com/google/smali/issues?q=is%3Aissue + about: Check Baksmali issues before reporting issue here. Your issue might already exists + - name: Android development and modding support forum + url: https://forum.xda-developers.com/c/android-development-and-hacking.564/ + about: For support, questions or help with development and modding' diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..c1aa6b8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,23 @@ +name: Feature request +description: Request a feature for APK Tool GUI +labels: enhancement +body: + - type: checkboxes + attributes: + label: Prerequisites + description: To rule out invalid issues, confirm and check each one of the checkboxes. + options: + - label: This is not a support issue or a question. For support, questions, or help, see [support links](https://github.com/AndnixSH/APKToolGUI/issues/new/choose). + required: true + - label: I performed a cursory search of the issue tracker on [APK Tool GUI](https://github.com/AndnixSH/APKToolGUI/issues?q=is%3Aissue) to avoid opening a duplicate issue + required: true + - label: I have read the [FAQ](https://github.com/AndnixSH/APKToolGUI#faq) + required: true + + - type: textarea + attributes: + label: Describe the feature you'd like + description: A clear and concise description of what you want to happen. Not all features will be accepted + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/language.yml b/.github/ISSUE_TEMPLATE/language.yml new file mode 100644 index 0000000..cbddda9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/language.yml @@ -0,0 +1,16 @@ +name: Language suggestion/error +description: Suggest a change or report an error of language. Use this form if you can't pull request +labels: language +body: + - type: input + attributes: + label: Language + validations: + required: true + - type: textarea + attributes: + label: Description + description: A clear and concise description of what you want to be changed. You can upload/paste screenshots here. For full translation, please upload zip file of translated files or full project + validations: + required: true + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..986d828 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + name: Checkout Code + + - name: Setup MSBuild Path + uses: microsoft/setup-msbuild@v1.3.1 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + + - name: Restore NuGet Packages + run: nuget restore APKToolGUI.sln + + - name: Build Application + run: msbuild APKToolGUI.sln /p:Configuration=Release + + - name: Create package directory + run: mkdir package + + - name: Copy essential files to package + shell: pwsh + run: | + Copy-Item APKToolGUI/bin/Release/APKToolGUI.exe package/ + Copy-Item changelog.txt package/Changelog.txt + + if (Test-Path APKToolGUI/bin/Release/Resources) { + Copy-Item APKToolGUI/bin/Release/Resources package/ -Recurse + } + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: APKToolGUI + path: package/ diff --git a/APKToolGUI/APKToolGUI.csproj b/APKToolGUI/APKToolGUI.csproj index c906840..1dc4e95 100644 --- a/APKToolGUI/APKToolGUI.csproj +++ b/APKToolGUI/APKToolGUI.csproj @@ -1,17 +1,24 @@ - - + + + + Debug x86 8.0.30703 2.0 {AA2C8BC1-ED99-463A-9363-F6A87FB2CF38} + + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} WinExe Properties APKToolGUI APKToolGUI - v4.0 - Client + v4.8 + + 512 false Properties\AssemblyInfo.cs @@ -20,6 +27,8 @@ False None.None.None.Increment None.None.None.Increment + + publish\ true Disk @@ -45,7 +54,7 @@ prompt 4 true - true + false AnyCPU @@ -57,10 +66,10 @@ 4 Auto false - true + false - android.ico + android-thin.ico LocalIntranet @@ -72,9 +81,203 @@ + + ..\packages\Costura.Fody.6.0.0\lib\netstandard2.0\Costura.dll + + + + ..\packages\Microsoft.Bcl.HashCode.6.0.0\lib\net462\Microsoft.Bcl.HashCode.dll + + + + + + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + ..\packages\Microsoft-WindowsAPICodePack-Core.1.1.5\lib\net48\Microsoft.WindowsAPICodePack.dll + + + ..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.5\lib\net48\Microsoft.WindowsAPICodePack.Shell.dll + + + ..\packages\Ookii.Dialogs.WinForms.4.0.0\lib\net462\Ookii.Dialogs.WinForms.dll + + + ..\packages\OSVersionExt.3.0.0\lib\net462\OSVersionExt.dll + + + ..\packages\PortableSettingsProvider.0.2.5\lib\net45\PortableSettingsProvider.dll + + + + + ..\packages\ProDotNetZip.1.20.0\lib\netstandard2.0\ProDotNetZip.dll + + + ..\packages\ResourceLoader.3.3.1\lib\netstandard2.0\ResourceLoader.dll + + + ..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll + True + True + + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.9.0.10\lib\net462\System.Collections.Immutable.dll + + + + ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll + True + True + + + + + ..\packages\System.Diagnostics.DiagnosticSource.9.0.10\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + + + + ..\packages\System.Formats.Nrbf.9.0.10\lib\net462\System.Formats.Nrbf.dll + + + ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + + + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + + ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + ..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll + True + True + + + ..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll + True + True + + + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll + + + + ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True + True + + + ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + + + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll + + + ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll + True + True + + + ..\packages\System.Reflection.Metadata.9.0.10\lib\net462\System.Reflection.Metadata.dll + + + ..\packages\System.Resources.Extensions.9.0.10\lib\net462\System.Resources.Extensions.dll + + + ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll + True + True + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll + True + True + + + ..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll + True + True + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + ..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\packages\System.Security.Permissions.9.0.10\lib\net462\System.Security.Permissions.dll + + + ..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + + + + ..\packages\System.Text.Encoding.CodePages.9.0.10\lib\net462\System.Text.Encoding.CodePages.dll + + + ..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll + True + True + + + @@ -82,84 +285,102 @@ + + ..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + - + + + + + Component - + Component - - - - Form - - - FormAboutBox.cs - - - Form - - - FormBuild.cs + + Component - - Form + + Component - - FormDecode.cs + + Component - - Form + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + AboutWindow.xaml - - FormMain.cs + + MSBuild:Compile + Designer + + + SettingsWindow.xaml - - Form + + MSBuild:Compile + Designer + + + MainWindow.xaml - - FormSettings.cs + + MainWindow.xaml + + MSBuild:Compile + Designer + Component - + + - + True True Language.resx - - - FormAboutBox.cs - - - FormAboutBox.cs - - - FormBuild.cs - - - FormDecode.cs - - - FormMain.cs - - - FormMain.cs - - - FormSettings.cs - - - FormSettings.cs - - + + + + + + Component + + + + + + + + ResXFileCodeGenerator Resources.Designer.cs @@ -170,11 +391,12 @@ Resources.resx True - + ResXFileCodeGenerator Language.Designer.cs + SettingsSingleFileGenerator @@ -187,15 +409,14 @@ - + + + + - - - - - + @@ -221,9 +442,29 @@ + + + + if not exist "$(ProjectDir)\$(OutDir)\Resources" xcopy "$(SolutionDir)\Tools" "$(ProjectDir)\$(OutDir)\Resources" /Y /I /S + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + - xcopy $(ProjectDir)tools $(ProjectDir)$(OutDir)bin /Y /I /S + + + + + \ No newline at end of file diff --git a/APKToolGUI/APKToolGUI.csproj.user b/APKToolGUI/APKToolGUI.csproj.user index 67d14de..35b92b7 100644 --- a/APKToolGUI/APKToolGUI.csproj.user +++ b/APKToolGUI/APKToolGUI.csproj.user @@ -1,4 +1,4 @@ - + publish\ @@ -9,6 +9,7 @@ ru-RU false + ShowAllFiles false diff --git a/APKToolGUI/ApkTool/AaptParser.cs b/APKToolGUI/ApkTool/AaptParser.cs new file mode 100644 index 0000000..60f76f4 --- /dev/null +++ b/APKToolGUI/ApkTool/AaptParser.cs @@ -0,0 +1,413 @@ +using APKToolGUI.Web; +using Ionic.Zip; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Documents; + +namespace APKToolGUI.Utils +{ + public class AaptParser + { + public string ApkFile; + + public string RealApkFile; + + public string Armv7ApkFile; + + public string Arm64ApkFile; + + public string AppName; + + public string PackageName; + + public string VersionName; + + public string VersionCode; + + public string MinSdkVersionDetailed; + + public string TargetSdkVersionDetailed; + + public string MinSdkVersion; + + public string TargetSdkVersion; + + public string LaunchableActivity; + + public string Permissions; + + public string Screens; + + public string Locales; + + public string Densities; + + public string NativeCode; + + public string PlayStoreLink; + + public string ApkComboLink; + + public string ApkPureLink; + + public string ApkAioLink; + + public string ApkGkLink; + + public string ApkSupportLink; + + public string ApkSosLink; + + public string ApkMirrorLink; + + public string ApkDlLink; + + public string FullInfo; + + internal string AppIcon = null; + + internal string AppIcon120 = null; + + internal string AppIcon160 = null; + + internal string AppIcon240 = null; + + internal string AppIcon320 = null; + + internal string AppIcon480 = null; + + internal string AppIcon640 = null; + + internal string AppIcon65534 = null; + + public bool Parse(string file) + { + bool result = true; + + string info = ParseApkInfo(file); + + FullInfo = info; + + if (!String.IsNullOrEmpty(info)) + { + string[] lines = info.Split( + new string[] { "\r\n", "\r", "\n" }, + StringSplitOptions.None); + + List nativecode = new List { }; + List nativecode2 = new List { }; + StringBuilder permissionsBuilder = new StringBuilder(); + foreach (string line in lines) + { + switch (line.Split(':')[0]) + { + case "package": + PackageName = StringExt.RegexExtract(@"(?<=package: name=\')(.*?)(?=\')", line); + VersionName = StringExt.RegexExtract(@"(?<=versionName=\')(.*?)(?=\')", line); + VersionCode = StringExt.RegexExtract(@"(?<=versionCode=\')(.*?)(?=\')", line); + break; + case "uses-permission": + permissionsBuilder.AppendLine(StringExt.RegexExtract(@"(?<=name=\')(.*?)(?=\')", line)); + break; + case "sdkVersion": + MinSdkVersionDetailed = SdkToAndroidVer(StringExt.RegexExtract(@"(?<=sdkVersion:\')(.*?)(?=\')", line)); + MinSdkVersion = StringExt.RegexExtract(@"(?<=sdkVersion:\')(.*?)(?=\')", line); + break; + case "targetSdkVersion": + TargetSdkVersionDetailed = SdkToAndroidVer(StringExt.RegexExtract(@"(?<=targetSdkVersion:\')(.*?)(?=\')", line)); + TargetSdkVersion = StringExt.RegexExtract(@"(?<=targetSdkVersion:\')(.*?)(?=\')", line); + break; + case "application-label": + AppName = StringExt.RegexExtract(@"(?<=application-label:\')(.*?)(?=\')", line); + break; + case "launchable-activity": + LaunchableActivity = StringExt.RegexExtract(@"(?<=name=\')(.*?)(?=\')", line); + break; + case "supports-screens": + var screens = Regex.Matches(line.Split(':')[1], @"(?<= \')(.*?)(?=\')").Cast().Select(m => m.Value).ToList(); + Screens = string.Join(", ", screens); + break; + case "locales": + var locales = Regex.Matches(line.Split(':')[1], @"(?<= \')(.*?)(?=\')").Cast().Select(m => m.Value).ToList(); + Locales = string.Join(", ", locales); + break; + case "densities": + var densities = Regex.Matches(line.Split(':')[1], @"(?<= \')(.*?)(?=\')").Cast().Select(m => m.Value).ToList(); + Densities = string.Join(", ", densities); + break; + case "alt-native-code": + nativecode2 = Regex.Matches(line.Split(':')[1], @"(?<= \')(.*?)(?=\')").Cast().Select(m => m.Value).ToList(); + break; + case "native-code": + nativecode = Regex.Matches(line.Split(':')[1], @"(?<= \')(.*?)(?=\')").Cast().Select(m => m.Value).ToList(); + break; + } + } + + Permissions = permissionsBuilder.ToString(); + List combinedList = nativecode2.Concat(nativecode).ToList(); + NativeCode += string.Join(", ", combinedList); + ApkFile = file; + PlayStoreLink = "https://play.google.com/store/apps/details?id=" + PackageName; + ApkComboLink = "https://apkcombo.com/a/" + PackageName; + ApkPureLink = "https://apkpure.com/a/" + PackageName; + ApkSupportLink = "https://apk.support/app/" + PackageName; + ApkMirrorLink = "https://www.apkmirror.com/?post_type=app_release&searchtype=apk&s=" + PackageName; + ApkGkLink = "https://apkgk.com/" + PackageName + "/download"; + + AppIcon120 = StringExt.RegexExtract(@"(?<=application-icon-120:\')(.*?)(?=\')", FullInfo); + AppIcon160 = StringExt.RegexExtract(@"(?<=application-icon-160:\')(.*?)(?=\')", FullInfo); + AppIcon240 = StringExt.RegexExtract(@"(?<=application-icon-240:\')(.*?)(?=\')", FullInfo); + AppIcon320 = StringExt.RegexExtract(@"(?<=application-icon-320:\')(.*?)(?=\')", FullInfo); + AppIcon480 = StringExt.RegexExtract(@"(?<=application-icon-480:\')(.*?)(?=\')", FullInfo); + AppIcon640 = StringExt.RegexExtract(@"(?<=application-icon-640:\')(.*?)(?=\')", FullInfo); + AppIcon65534 = StringExt.RegexExtract(@"(?<=application-icon-65534:\')(.*?)(?=\')", FullInfo); + + result = true; + } + else + result = false; + + return result; + } + + private string ParseApkInfo(string path) + { + //For some reason, aapt2 hangs, so we will only use aapt2 when aapt1 fails to read UTF-8 character + string apkinfo = CMD.ProcessStartWithOutput(Program.AAPT_PATH, "dump badging \"" + path + "\""); + if (String.IsNullOrEmpty(apkinfo)) + { + string apkinfo2 = CMD.ProcessStartWithOutput(Program.AAPT2_PATH, "dump badging \"" + path + "\""); + if (!String.IsNullOrEmpty(apkinfo2)) + { + return apkinfo2; + } + else + return ""; + } + else + return apkinfo; + } + + // mipmap/drawable density folders to probe when the manifest points at an adaptive XML icon. + private static readonly string[] IconPngFolders = + { + "mipmap-xxxhdpi-v4", "mipmap-xxhdpi-v4", "mipmap-xhdpi-v4", "mipmap-hdpi-v4", "mipmap-mdpi-v4", + "mipmap-xhdpi", "mipmap-hdpi", + "drawable-xxxhdpi-v4", "drawable-xxhdpi-v4", "drawable-xhdpi-v4", "drawable-hdpi-v4", "drawable-mdpi-v4" + }; + + // Resolves the launcher icon to raw image bytes in memory — nothing is written to disk. + // Resolution order: + // 1) Direct raster lookup inside the (base) APK using the aapt-reported icon path. + // 2) resources.arsc parse — handles optimized/obfuscated resource names and adaptive + // icons (falls back to the foreground-layer raster). + // 3) Split-APK fallback — density resources (incl. the launcher icon) usually live in + // the config.*dpi.apk splits, not base.apk. When a split folder is supplied, scan it. + // Returns the PNG/WebP bytes, or null when no icon could be found. + public byte[] GetIconBytes(string apkPath, string splitSearchFolder = null) + { + try + { + // Pick the largest-density icon aapt reported (precedence: 65534 → 120). + string icon = PickPreferredIcon(); + + // Adaptive icons are declared as XML; the real raster lives next to it as a PNG. + if (Path.GetExtension(icon).Equals(".xml", StringComparison.OrdinalIgnoreCase)) + icon = icon.Replace(".xml", ".png"); + + Debug.WriteLine("Icon: " + icon); + + string[] candidates = BuildIconCandidates(icon); + + // 1) Direct raster lookup inside the (base) APK. + byte[] iconBytes = ReadIconFromApk(apkPath, candidates); + + // 2) resources.arsc fallback. + if (iconBytes == null) + { + Debug.WriteLine("Falling back to resources.arsc extraction method"); + iconBytes = ApkIconExtractor.ExtractIcon(apkPath); + } + + // 3) Split-APK fallback: density resources (incl. the launcher icon) usually live + // in config.*dpi.apk splits, not base.apk. Scan the extracted splits. + if (iconBytes == null && !String.IsNullOrEmpty(splitSearchFolder) && Directory.Exists(splitSearchFolder)) + { + foreach (string split in Directory.GetFiles(splitSearchFolder, "*.apk", SearchOption.AllDirectories)) + { + if (String.Equals(split, apkPath, StringComparison.OrdinalIgnoreCase)) + continue; // base.apk already tried above + + iconBytes = ReadIconFromApk(split, candidates) ?? ApkIconExtractor.ExtractIcon(split); + if (iconBytes != null) + { + Debug.WriteLine("Icon resolved from split: " + Path.GetFileName(split)); + break; + } + } + } + + if (iconBytes == null) + Debug.WriteLine("Icon not found in " + Path.GetFileName(apkPath)); + + return iconBytes; + } + catch (Exception ex) + { + Debug.WriteLine("GetIconBytes failed: " + ex.Message); + return null; + } + } + + // Highest-density icon wins; fall back through the precedence chain. + private string PickPreferredIcon() + { + foreach (var candidate in new[] { AppIcon65534, AppIcon640, AppIcon480, AppIcon320, AppIcon240, AppIcon160, AppIcon120 }) + { + if (!String.IsNullOrEmpty(candidate)) + return candidate; + } + return ""; + } + + // Expand the chosen icon path into the set of ZIP entries to probe, resolving + // adaptive (v26) icons to their density-specific PNG forms. + private static string[] BuildIconCandidates(string icon) + { + if (String.IsNullOrEmpty(icon)) + return new string[0]; + + if (icon.Contains("anydpi-v26")) + return IconPngFolders + .Select(p => icon.Replace("mipmap-anydpi-v26", p).Replace("drawable-anydpi-v26", p)) + .ToArray(); + + if (icon.Contains("v26")) + return new[] { icon.Replace("v26", "v4"), icon.Replace("-v26", "") }; + + return new[] { icon }; + } + + // Reads the first matching candidate entry from an APK/ZIP into a byte[], or null if none. + private static byte[] ReadIconFromApk(string apkFile, string[] candidates) + { + if (String.IsNullOrEmpty(apkFile) || candidates == null || candidates.Length == 0 || !File.Exists(apkFile)) + return null; + + try + { + using (ZipFile zip = ZipFile.Read(apkFile)) + { + foreach (var candidate in candidates) + { + if (String.IsNullOrEmpty(candidate)) continue; + var entry = zip[candidate.Replace('\\', '/')]; + if (entry == null) continue; + + Debug.WriteLine("Icon stream: " + candidate + " from " + Path.GetFileName(apkFile)); + using (var ms = new MemoryStream()) + { + entry.Extract(ms); + return ms.ToArray(); + } + } + } + } + catch (Exception ex) + { + Debug.WriteLine("Icon read failed from " + apkFile + ": " + ex.Message); + } + return null; + } + + //https://apilevels.com/ + public string SdkToAndroidVer(string sdk) + { + switch (sdk) + { + case "36": + return sdk + ": Android 16"; + case "35": + return sdk + ": Android 15"; + case "34": + return sdk + ": Android 14"; + case "33": + return sdk + ": Android 13"; + case "32": + return sdk + ": Android 12.0L"; + case "31": + return sdk + ": Android 12"; + case "30": + return sdk + ": Android 11"; + case "29": + return sdk + ": Android 10"; + case "28": + return sdk + ": Android 9 (Pie)"; + case "27": + return sdk + ": Android 8.1 (Oreo)"; + case "26": + return sdk + ": Android 8.0 (Oreo)"; + case "25": + return sdk + ": Android 7.1 (Nougat)"; + case "24": + return sdk + ": Android 7.0 (Nougat)"; + case "23": + return sdk + ": Android 6 (Marshmallow)"; + case "22": + return sdk + ": Android 5.1 (Lollipop)"; + case "21": + return sdk + ": Android 5.0 (Lollipop)"; + case "20": + return sdk + ": Android 4.4W (KitKat Watch)"; + case "19": + return sdk + ": Android 4.4 (KitKat)"; + case "18": + return sdk + ": Android 4.3 (Jelly Bean)"; + case "17": + return sdk + ": Android 4.2 (Jelly Bean)"; + case "16": + return sdk + ": Android 4.1 (Jelly Bean)"; + case "15": + return sdk + ": Android 4.0.3 (Ice Cream Sandwich)"; + case "14": + return sdk + ": Android 4.0 (Ice Cream Sandwich)"; + case "13": + return sdk + ": Android 3.2 (Honeycomb)"; + case "12": + return sdk + ": Android 3.1 (Honeycomb)"; + case "11": + return sdk + ": Android 3.0 (Honeycomb)"; + case "10": + return sdk + ": Android 2.3.3 Gingerbread"; + case "9": + return sdk + ": Android 2.3 (Gingerbread)"; + case "8": + return sdk + ": Android 2.2 (Froyo)"; + case "7": + return sdk + ": Android 2.1 (Eclair)"; + case "6": + return sdk + ": Android 2.0.1 (Eclair)"; + case "5": + return sdk + ": Android 2.0 (Eclair)"; + case "4": + return sdk + ": Android 1.6 (Donut)"; + case "3": + return sdk + ": Android 1.5 (Cupcake)"; + case "2": + return sdk + ": Android 1.1 (Base 1.1)"; + case "1": + return sdk + ": Android 1.0 (Base)"; + default: + return sdk; + } + } + } +} diff --git a/APKToolGUI/ApkTool/Adb.cs b/APKToolGUI/ApkTool/Adb.cs new file mode 100644 index 0000000..88cd096 --- /dev/null +++ b/APKToolGUI/ApkTool/Adb.cs @@ -0,0 +1,201 @@ +using APKToolGUI.Properties; +using APKToolGUI.Utils; +using Java; +using Microsoft.Build.Framework.XamlTypes; +using System; +using System.Diagnostics; +using System.IO; +using System.Text.RegularExpressions; +using System.Windows.Shapes; + +namespace APKToolGUI +{ + public class Adb : IDisposable + { + Process processAdb; + private bool disposed = false; + + static class Keys + { + public const string Devices = " devices -l"; //list connected devices (-l for long output) + public const string Serial = " -s"; // use device with given serial (overrides $ANDROID_SERIAL) + public const string Vendor = " -i"; //Vendor + public const string ApkPath = " -r"; + public const string Abi = " --abi"; //override platform's default ABI + } + + public event DataReceivedEventHandler OutputDataReceived + { + add { processAdb.OutputDataReceived += value; } + remove { processAdb.OutputDataReceived -= value; } + } + + public event DataReceivedEventHandler ErrorDataReceived + { + add { processAdb.ErrorDataReceived += value; } + remove { processAdb.ErrorDataReceived -= value; } + } + + public event EventHandler Exited; + public int ExitCode { get { return processAdb.ExitCode; } } + string adbFileName = null; + public Adb(string AdbFileName) + { + adbFileName = AdbFileName; + processAdb = new Process(); + processAdb.EnableRaisingEvents = true; + processAdb.StartInfo.FileName = AdbFileName; + processAdb.StartInfo.UseShellExecute = false; // Disable shell execution to read output data + processAdb.StartInfo.RedirectStandardOutput = true; // Allow output redirection + processAdb.StartInfo.RedirectStandardError = true; // Allow error redirection + processAdb.StartInfo.CreateNoWindow = true; // Do not create window for the launched program + processAdb.Exited += processAdb_Exited; + } + + void processAdb_Exited(object sender, EventArgs e) + { + processAdb.CancelOutputRead(); + processAdb.CancelErrorRead(); + if (this.Exited != null) + Exited(this, new EventArgs()); + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("adb")) + { + using (process) + { + if (process.Id == processAdb.Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)processAdb.Id); + process.Kill(); + } + } + } + } + catch (Exception ex) + { + Debug.WriteLine($"[Adb] Cancel failed: {ex.Message}"); + // Process termination failure is not critical, so continue + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + if (processAdb != null) + { + try + { + if (!processAdb.HasExited) + { + processAdb.Kill(); + } + } + catch (Exception ex) + { + Debug.WriteLine($"[Adb] Error disposing process: {ex.Message}"); + } + finally + { + processAdb.Dispose(); + processAdb = null; + } + } + } + disposed = true; + } + } + + ~Adb() + { + Dispose(false); + } + + public int Install(string device, string inputApk) + { + Regex regex = new Regex(@"^(\S+)\s+.*model:(\w+).*"); + Match mdevice = regex.Match(device); + + string setVendor = null, abi = null; + if (Settings.Default.Adb_SetVendor) + setVendor = $"{Keys.Vendor} com.android.vending {Keys.ApkPath}"; + if (Settings.Default.Adb_SetOverrideAbi) + { + switch (Settings.Default.Adb_OverrideAbi) + { + case 0: + abi = Keys.Abi + " arm64-v8a"; + break; + case 1: + abi = Keys.Abi + " armeabi-v7a"; + break; + case 2: + abi = Keys.Abi + " x86"; + break; + case 3: + abi = Keys.Abi + " x86_64"; + break; + } + } + + string args = String.Format($"{Keys.Serial} {mdevice.Groups[1].Value} install {setVendor} {abi} \"{inputApk}\""); + + Log.d("ADB: " + adbFileName + " " + args); + Debug.WriteLine("Adb: " + args); + + processAdb.EnableRaisingEvents = false; + processAdb.StartInfo.Arguments = args; + processAdb.Start(); + processAdb.BeginOutputReadLine(); + processAdb.BeginErrorReadLine(); + processAdb.WaitForExit(); + + return ExitCode; + } + + public string GetDevices() + { + Log.d("ADB: " + adbFileName + " " + Keys.Devices); + + using (Process process = new Process()) + { + process.EnableRaisingEvents = true; + process.StartInfo.FileName = adbFileName; + process.StartInfo.UseShellExecute = false; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.CreateNoWindow = true; + process.EnableRaisingEvents = false; + process.StartInfo.Arguments = Keys.Devices; + process.Start(); + string devices = process.StandardOutput.ReadToEnd(); + process.WaitForExit(); + return devices; + } + } + + public void KillProcess() + { + foreach (var process in Process.GetProcessesByName("adb")) + { + using (process) + { + process.Kill(); + } + } + } + } +} diff --git a/APKToolGUI/ApkTool/ApkEditor.cs b/APKToolGUI/ApkTool/ApkEditor.cs new file mode 100644 index 0000000..9a7bdd2 --- /dev/null +++ b/APKToolGUI/ApkTool/ApkEditor.cs @@ -0,0 +1,243 @@ +using System; +using Java; +using System.Diagnostics; +using APKToolGUI.Properties; +using System.IO; +using APKToolGUI.Utils; +using System.Windows.Forms; + +namespace APKToolGUI +{ + public class ApkEditor : JarProcess, IDisposable + { + private bool disposed = false; + + public new event ApkEditorExitedEventHandler Exited; + + string _jarPath; + public ApkEditor(string javaPath, string jarPath) + : base(javaPath, jarPath) + { + this._jarPath = jarPath; + base.Exited += ApkEditor_Exited; + OutputDataReceived += ApkEditor_OutputDataReceived; + ErrorDataReceived += ApkEditor_ErrorDataReceived; //Output makes process way slower + } + + ApkEditorDataReceivedEventHandler onApkEditorOutputDataRecieved; + ApkEditorDataReceivedEventHandler onApkEditorErrorDataRecieved; + + public event ApkEditorDataReceivedEventHandler ApkEditorOutputDataRecieved + { + add + { + onApkEditorOutputDataRecieved += value; + } + remove + { + onApkEditorOutputDataRecieved -= value; + } + } + public event ApkEditorDataReceivedEventHandler ApkEditorErrorDataRecieved + { + add + { + onApkEditorErrorDataRecieved += value; + } + remove + { + onApkEditorErrorDataRecieved -= value; + } + } + + + private void ApkEditor_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + if (onApkEditorErrorDataRecieved != null && e.Data != null) + onApkEditorErrorDataRecieved(this, new ApkEditorDataReceivedEventArgs(e.Data)); + } + + private void ApkEditor_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + if (onApkEditorOutputDataRecieved != null && e.Data != null) + onApkEditorOutputDataRecieved(this, new ApkEditorDataReceivedEventArgs(e.Data)); + } + + void ApkEditor_Exited(object sender, EventArgs e) + { + if (Exited != null) + Exited(this, new ApkEditorExitedEventArgs(ExitCode)); + } + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("java")) + { + using (process) + { + if (process.Id == Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)Id); + process.Kill(); + } + } + } + } + catch (InvalidOperationException ex) + { + Debug.WriteLine($"[ApkEditor] Process already exited: {ex.Message}"); + } + catch (System.ComponentModel.Win32Exception ex) + { + Debug.WriteLine($"[ApkEditor] Failed to access process: {ex.Message}"); + } + catch (Exception ex) + { + Debug.WriteLine($"[ApkEditor] Failed to cancel process: {ex.Message}"); + } + } + + public int Merge(string input, string output) + { + string inputFile = String.Format("-i \"{0}\"", input); + string keyOutputDir = String.Format("-o \"{0}\"", output); + + string args = String.Format("m {0} {1} -f", inputFile, keyOutputDir); + + Log.d("ApkEditor CMD: " + _jarPath + " " + args); + + Start(args); + + BeginOutputReadLine(); + BeginErrorReadLine(); + + WaitForExit(); + + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + + public int Decompile(string input, string output) + { + string inputFile = String.Format("-i \"{0}\"", input); + string keyOutputDir = String.Format("-o \"{0}\"", output); + + string args = String.Format("d {0} {1} -f", inputFile, keyOutputDir); + + Log.d("ApkEditor CMD: " + _jarPath + " " + args); + + Start(args); + + BeginOutputReadLine(); + BeginErrorReadLine(); + + WaitForExit(); + + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + + public int Build(string input, string output) + { + string inputFile = String.Format("-i \"{0}\"", input); + string keyOutputDir = String.Format("-o \"{0}\"", output); + + string args = String.Format("b {0} {1} -f", inputFile, keyOutputDir); + + Log.d("ApkEditor CMD: " + _jarPath + " " + args); + + Start(args); + + BeginOutputReadLine(); + BeginErrorReadLine(); + + WaitForExit(); + + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + public string GetVersion() + { + using (JarProcess jar = new JarProcess(JavaPath, JarPath)) + { + jar.EnableRaisingEvents = false; + jar.Start("-version"); + + //APKEditor always print as errors as usual :) + string version = jar.StandardOutput.ReadToEnd(); + version += jar.StandardError.ReadToEnd(); + jar.WaitForExit(3000); + return version.Replace("\r\n", ""); + } + } + + public new void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected new virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + try + { + Cancel(); + } + catch (Exception ex) + { + Debug.WriteLine($"[ApkEditor] Error during disposal: {ex.Message}"); + } + finally + { + base.Dispose(); + } + } + disposed = true; + } + } + + ~ApkEditor() + { + Dispose(false); + } + } + + public class ApkEditorExitedEventArgs : EventArgs + { + public ApkEditorExitedEventArgs(int exitCode) + { + ExitCode = exitCode; + } + + public int ExitCode { get; private set; } + } + + public delegate void ApkEditorExitedEventHandler(object sender, ApkEditorExitedEventArgs e); + + public delegate void ApkEditorDataReceivedEventHandler(Object sender, ApkEditorDataReceivedEventArgs e); + + public class ApkEditorDataReceivedEventArgs : EventArgs + { + string message; + + public ApkEditorDataReceivedEventArgs(string _data) + { + message = _data; + } + public String Message + { + get + { + return message; + } + } + } +} diff --git a/APKToolGUI/ApkTool/ApkFixer.cs b/APKToolGUI/ApkTool/ApkFixer.cs new file mode 100644 index 0000000..cac62fe --- /dev/null +++ b/APKToolGUI/ApkTool/ApkFixer.cs @@ -0,0 +1,115 @@ + + +using APKToolGUI.Utils; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace APKToolGUI.ApkTool +{ + public class ApkFixer + { + public static bool FixAndroidManifest(string decompilePath) + { + string manifestPath = Path.Combine(decompilePath, "AndroidManifest.xml"); + if (!File.Exists(manifestPath)) + return false; + + try + { + string manifestText = File.ReadAllText(manifestPath); + manifestText = manifestText.Replace("\\ ", "\\u003"); + manifestText = manifestText.Replace("android:isSplitRequired=\"true\"", ""); + manifestText = manifestText.Replace("android:extractNativeLibs=\"false\"", ""); + manifestText = manifestText.Replace("android:useEmbeddedDex=\"true\"", ""); + manifestText = manifestText.Replace("android:manageSpace=\"true\"", ""); + manifestText = manifestText.Replace("android:localeConfig=\"@xml/locales_config\"", ""); + manifestText = manifestText.Replace("STAMP_TYPE_DISTRIBUTION_APK", "STAMP_TYPE_STANDALONE_APK"); + manifestText = Regex.Replace(manifestText, @"\s*android:requiredSplitTypes=""[^""]*""", ""); + manifestText = Regex.Replace(manifestText, @"\s*android:splitTypes=""[^""]*""", ""); + + File.WriteAllText(manifestPath, manifestText); + return true; + } + catch (IOException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Failed to fix AndroidManifest.xml: {ex.Message}"); + return false; + } + catch (UnauthorizedAccessException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Access denied to AndroidManifest.xml: {ex.Message}"); + return false; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Unexpected error fixing AndroidManifest.xml: {ex.Message}"); + return false; + } + } + + public static bool FixApktoolYml(string decompilePath) + { + string ymlPath = Path.Combine(decompilePath, "apktool.yml"); + if (!File.Exists(ymlPath)) + return false; + + try + { + string yml = File.ReadAllText(ymlPath); + yml = yml.Replace("sparseResources: true", "sparseResources: false"); + + File.WriteAllText(ymlPath, yml); + return true; + } + catch (IOException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Failed to fix apktool.yml: {ex.Message}"); + return false; + } + catch (UnauthorizedAccessException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Access denied to apktool.yml: {ex.Message}"); + return false; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Unexpected error fixing apktool.yml: {ex.Message}"); + return false; + } + } + + public static bool RemoveApkToolDummies(string path) + { + string resPath = Path.Combine(path, "res", "values"); + if (!Directory.Exists(resPath)) + return false; + + try + { + DirectoryUtils.ReplaceinFilesRegex(resPath, "(.*(?:APKTOOL_DUMMY).*)", ""); + return true; + } + catch (IOException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Failed to remove APKTOOL_DUMMY: {ex.Message}"); + return false; + } + catch (UnauthorizedAccessException ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Access denied while removing APKTOOL_DUMMY: {ex.Message}"); + return false; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"[ApkFixer] Unexpected error removing APKTOOL_DUMMY: {ex.Message}"); + return false; + } + } + } +} diff --git a/APKToolGUI/ApkTool/Apktool.cs b/APKToolGUI/ApkTool/Apktool.cs new file mode 100644 index 0000000..e281ac2 --- /dev/null +++ b/APKToolGUI/ApkTool/Apktool.cs @@ -0,0 +1,504 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Windows.Forms; +using APKToolGUI.Properties; +using APKToolGUI.Utils; +using Java; + +namespace APKToolGUI +{ + public class Apktool : JarProcess, IDisposable + { + private bool disposed = false; + private static readonly Regex ApktoolVersionRegex = new Regex(@"v?(?\d+\.\d+\.\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + public Version ParsedVersion { get; private set; } + public string Version { get; private set; } + + public Apktool(string javaPath, string jarPath) : base(javaPath, jarPath) + { + Exited += Apktool_Exited; + OutputDataReceived += Apktool_OutputDataReceived; + ErrorDataReceived += Apktool_ErrorDataReceived; + + string apktoolVersion = GetVersion(); + string apktoolVersionOld = GetVersionOld(); + if (!String.IsNullOrWhiteSpace(apktoolVersion) && !Regex.IsMatch(apktoolVersion, @"\r\n?|\n")) + Version = apktoolVersion; + else if (!String.IsNullOrWhiteSpace(apktoolVersionOld) && !Regex.IsMatch(apktoolVersionOld, @"\r\n?|\n")) + Version = apktoolVersionOld; + + ParsedVersion = ParseVersion(Version); + + Debug.WriteLine($"[Apktool] Parsed version: {ParsedVersion}"); + } + + static class DecompileKeys + { + //Do not decode sources. + public const string NoSource = "-s"; + + //Do not decode resources. + public const string NoResource = "-r"; + + //don't write out debug info (.local, .param, .line, etc.) + //The -b flag has been removed from APKtool 3.0.1 and later versions, + //but the --no-debug-info flag is supported in all versions. + public const string NoDebugInfo = "--no-debug-info"; + + //Skip changes detection and build all files. + public const string Force = "-f"; + + //Uses framework files located in . + public const string FrameworkPath = "-p"; + + //Use if there was an error and some resources were dropped + public const string KeepBrokenResource = "--keep-broken-res"; + + //Keeps files to closest to original as possible. Prevents rebuild. + public const string MatchOriginal = "--match-original"; + + //The name of folder that gets written. Default is apk.out + public const string OutputDir = "-o"; + + //Only disassemble the main dex classes (classes[0-9]*.dex) in the root. + public const string OnlyMainClasses = "--only-main-classes"; + + //The numeric api-level of the file to generate, e.g. 14 for ICS. + public const string ApiLevel = "-api"; + + // Sets the number of threads to use. + public const string Jobs = "-j"; + } + + static class BuildKeys + { + //Skip changes detection and build all files. + public const string ForceAll = "-f"; + + //opies original AndroidManifest.xml and META-INF. See project page for more info. + public const string CopyOriginal = "--copy-original"; + + //Loads aapt from specified location. + public const string Aapt = "-a"; + + //Uses framework files located in . + public const string FrameworkPath = "-p"; + + // The name of apk that gets written. Default is dist/name.apk + public const string OutputAppPath = "-o"; + + // Disable crunching of resource files during the build step. + public const string NoCrunch = "--no-crunch"; + + //The numeric api-level of the file to generate, e.g. 14 for ICS. + public const string ApiLevel = "-api"; + + //Upgrades apktool to use experimental aapt2 binary. + public const string UseAapt2 = "--use-aapt2"; + + //Add a generic Network Security Configuration file in the output APK + public const string NetSecConf = "--net-sec-conf"; + + // Sets the number of threads to use. + public const string Jobs = "-j"; + } + + static class InstallFrameworkKeys + { + //Stores framework files into . + public const string FrameDir = "-p"; + + //Tag frameworks using . + public const string Tag = "-t"; + } + + static class EmptyFrameworkKeys + { + //Stores framework files into . + public const string FrameDir = "-p"; + + //Force delete destination directory. + public const string ForceDelete = "-f"; + + //Include all framework files regardless of tag. (3.0.1+) + public const string All = "-a"; + } + + ApktoolDataReceivedEventHandler onApktoolOutputDataRecieved; + ApktoolDataReceivedEventHandler onApktoolErrorDataRecieved; + + public event ApktoolDataReceivedEventHandler ApktoolOutputDataRecieved + { + add + { + onApktoolOutputDataRecieved += value; + } + remove + { + onApktoolOutputDataRecieved -= value; + } + } + public event ApktoolDataReceivedEventHandler ApktoolErrorDataRecieved + { + add + { + onApktoolErrorDataRecieved += value; + } + remove + { + onApktoolErrorDataRecieved -= value; + } + } + + private void Apktool_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + if (onApktoolErrorDataRecieved != null && e.Data != null) + onApktoolErrorDataRecieved(this, new ApktoolDataReceivedEventArgs(e.Data)); + } + + private void Apktool_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + if (onApktoolOutputDataRecieved != null && e.Data != null) + onApktoolOutputDataRecieved(this, new ApktoolDataReceivedEventArgs(e.Data)); + } + + private void Apktool_Exited(object sender, EventArgs e) + { + CancelOutputRead(); + CancelErrorRead(); + } + + public int Decompile(string inputPath, string outputDir) + { + string keyNoSrc = null, keyNoRes = null, keyForce = null, keyFramePath = null, keyMatchOriginal = null, keyOutputDir = null, onlyMainClasses = null, noDebugInfo = null, keyKeepBrokenRes = null, apiLevel = null, jobs = null; + + if (Settings.Default.Decode_NoSrc) + keyNoSrc = DecompileKeys.NoSource; + if (Settings.Default.Decode_NoRes) + keyNoRes = DecompileKeys.NoResource; + if (Settings.Default.Decode_Force) + keyForce = DecompileKeys.Force; + if (Settings.Default.Decode_KeepBrokenRes) + keyKeepBrokenRes = DecompileKeys.KeepBrokenResource; + if (Settings.Default.Decode_MatchOriginal) + keyMatchOriginal = DecompileKeys.MatchOriginal; + if (Settings.Default.Decode_OnlyMainClasses && !Settings.Default.Decode_NoSrc && IsVersionAtMost("2.12.1")) + onlyMainClasses = DecompileKeys.OnlyMainClasses; + if (Settings.Default.Decode_NoDebugInfo) + noDebugInfo = DecompileKeys.NoDebugInfo; + if (Settings.Default.Decode_UseFramework) + keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, Settings.Default.Framework_FrameDir); + else + keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, Program.STANDALONE_FRAMEWORK_DIR); + if (Settings.Default.Decode_SetApiLevel) + apiLevel = String.Format("{0} {1}", DecompileKeys.ApiLevel, Settings.Default.Decode_ApiLevel); + if (Settings.Default.Decode_SetJobs) + jobs = String.Format("{0} {1}", DecompileKeys.Jobs, Settings.Default.Decode_Jobs); + keyOutputDir = String.Format("{0} \"{1}\"", DecompileKeys.OutputDir, outputDir); + + string args = String.Format($"d {keyNoSrc} {keyNoRes} {keyForce} {onlyMainClasses} {noDebugInfo} {keyMatchOriginal} {keyFramePath} {keyKeepBrokenRes} {apiLevel} {jobs} {keyOutputDir} \"{inputPath}\""); + + Log.d("Apktool CMD: " + JarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + return ExitCode; + } + + public int Build(string inputFolder, string outputFile) + { + string keyForceAll = null, keyAapt = null, keyCopyOriginal = null, noCrunch = null, keyFramePath = null, keyOutputAppPath = null, apiLevel = null, jobs = null, useAapt2 = null, netSecConf = null; + + if (Settings.Default.Build_ForceAll) + keyForceAll = BuildKeys.ForceAll; + if (Settings.Default.Build_CopyOriginal) + keyCopyOriginal = BuildKeys.CopyOriginal; + if (Settings.Default.Build_NoCrunch) + noCrunch = BuildKeys.NoCrunch; + if (Settings.Default.Build_UseAapt) + keyAapt = String.Format("{0} \"{1}\"", BuildKeys.Aapt, Settings.Default.Build_AaptPath); + if (Settings.Default.Build_UseFramework) + keyFramePath = String.Format("{0} \"{1}\"", BuildKeys.FrameworkPath, Settings.Default.Framework_FrameDir); + else + keyFramePath = String.Format("{0} \"{1}\"", BuildKeys.FrameworkPath, Program.STANDALONE_FRAMEWORK_DIR); + if (Settings.Default.Build_SetApiLevel) + apiLevel = String.Format("{0} {1}", BuildKeys.ApiLevel, Settings.Default.Build_ApiLevel); + if (Settings.Default.Build_SetJobs) + jobs = String.Format("{0} {1}", BuildKeys.Jobs, Settings.Default.Build_Jobs); + if (Settings.Default.Build_UseAapt2) + useAapt2 = BuildKeys.UseAapt2; + if (Settings.Default.Build_NetSecConf) + netSecConf = BuildKeys.NetSecConf; + keyOutputAppPath = String.Format("{0} \"{1}\"", BuildKeys.OutputAppPath, outputFile); + + string args = String.Format($"b {keyForceAll} {keyAapt} {keyCopyOriginal} {noCrunch} {keyFramePath} {apiLevel} {jobs} {useAapt2} {netSecConf} {keyOutputAppPath} \"{inputFolder}\""); + + Log.d("Apktool CMD: " + JarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + return ExitCode; + } + + public int InstallFramework() + { + string inputPath = Settings.Default.InstallFramework_InputFramePath; + string keyFrameDir = null, keyTag = null; + + if (Settings.Default.Framework_UseFrameDir) + keyFrameDir = String.Format("{0} \"{1}\"", InstallFrameworkKeys.FrameDir, Settings.Default.Framework_FrameDir); + if (Settings.Default.InstallFramework_UseTag) + keyTag = String.Format("{0} \"{1}\"", InstallFrameworkKeys.Tag, Settings.Default.InstallFramework_Tag); + + string args = String.Format($"if {keyFrameDir} {keyTag} \"{inputPath}\""); + + Log.d("Apktool CMD: " + JarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + return ExitCode; + } + + public int ClearFramework() + { + string keyFramePath = null; + if (Settings.Default.Decode_UseFramework) + keyFramePath = String.Format("{0} \"{1}\"", InstallFrameworkKeys.FrameDir, Settings.Default.Framework_FrameDir); + else + keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, Program.STANDALONE_FRAMEWORK_DIR); + + string args = String.Format($"empty-framework-dir {EmptyFrameworkKeys.ForceDelete} {keyFramePath}"); + if (IsVersionAtLeast("3.0.1")) + args = String.Format($"clean-frameworks {EmptyFrameworkKeys.All} {keyFramePath}"); + + Log.d("Apktool CMD: " + JarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + return ExitCode; + } + + public bool IsVersionAtLeast(string minimumVersion) + { + if (String.IsNullOrWhiteSpace(minimumVersion)) + throw new ArgumentException("Minimum version cannot be null or empty.", nameof(minimumVersion)); + + return ParsedVersion.CompareTo(new Version(minimumVersion)) >= 0; + } + + public bool IsVersionAtMost(string maximumVersion) + { + if (String.IsNullOrWhiteSpace(maximumVersion)) + throw new ArgumentException("Maximum version cannot be null or empty.", nameof(maximumVersion)); + + return ParsedVersion.CompareTo(new Version(maximumVersion)) <= 0; + } + + private static Version ParseVersion(string rawVersion) + { + if (String.IsNullOrWhiteSpace(rawVersion)) + return null; + + Match match = ApktoolVersionRegex.Match(rawVersion.Trim()); + if (!match.Success) + return null; + + try + { + return new Version(match.Groups["version"].Value); + } + catch (Exception) + { + return null; + } + } + + public string GetVersion() + { + using (JarProcess apktoolJar = new JarProcess(JavaPath, JarPath)) + { + apktoolJar.EnableRaisingEvents = false; + apktoolJar.Start("version"); + string version = apktoolJar.StandardOutput.ReadToEnd(); + apktoolJar.WaitForExit(3000); + return version.Replace("\r\n", ""); + } + } + + public string GetVersionOld() + { + using (JarProcess apktoolJar = new JarProcess(JavaPath, JarPath)) + { + apktoolJar.EnableRaisingEvents = false; + apktoolJar.Start("-version"); + string version = apktoolJar.StandardOutput.ReadToEnd(); + apktoolJar.WaitForExit(3000); + return version.Replace("\r\n", ""); + } + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("java")) + { + using (process) + { + if (process.Id == Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)Id); + process.Kill(); + } + } + } + } + catch (InvalidOperationException ex) + { + Debug.WriteLine($"[Apktool] Process already exited: {ex.Message}"); + } + catch (System.ComponentModel.Win32Exception ex) + { + Debug.WriteLine($"[Apktool] Failed to access process: {ex.Message}"); + } + catch (Exception ex) + { + Debug.WriteLine($"[Apktool] Failed to cancel process: {ex.Message}"); + } + } + + public new void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected new virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + try + { + Cancel(); + } + catch (Exception ex) + { + Debug.WriteLine($"[Apktool] Error during disposal: {ex.Message}"); + } + finally + { + base.Dispose(); + } + } + disposed = true; + } + } + + ~Apktool() + { + Dispose(false); + } + } + + public delegate void ApktoolDataReceivedEventHandler(Object sender, ApktoolDataReceivedEventArgs e); + + public class ApktoolDataReceivedEventArgs : EventArgs + { + string data; + string message; + ApktoolEventType eventType; + + public ApktoolDataReceivedEventArgs(string _data) + { + data = _data; + SetData(); + } + public String Message + { + get + { + return message; + } + } + public ApktoolEventType EventType + { + get + { + return eventType; + } + } + + private void SetData() + { + MatchCollection mCol = Regex.Matches(data, @"^(\w+):\s(.+)$"); + if (mCol.Count > 0) + { + switch (mCol[0].Groups[1].Value) + { + case "W": + eventType = ApktoolEventType.Warning; + message = mCol[0].Groups[2].Value; + break; + case "Warning": + eventType = ApktoolEventType.Warning; + message = mCol[0].Groups[2].Value; + break; + case "I": + eventType = ApktoolEventType.None; + message = mCol[0].Groups[2].Value; + break; + case "Error": + eventType = ApktoolEventType.Error; + message = mCol[0].Groups[2].Value; + break; + case "E": + eventType = ApktoolEventType.Error; + message = mCol[0].Groups[2].Value; + break; + default: + eventType = ApktoolEventType.Unknown; + message = data; + break; + } + } + else + { + eventType = ApktoolEventType.Unknown; + message = data; + } + } + } + + public enum ApktoolEventType + { + None, + Success, + Infomation, + Warning, + Error, + Unknown + } + + enum ApktoolActionType + { + Decompile, + Build, + InstallFramework, + ClearFramework, + Null + } +} diff --git a/APKToolGUI/ApkTool/Baksmali.cs b/APKToolGUI/ApkTool/Baksmali.cs new file mode 100644 index 0000000..3a3a2bd --- /dev/null +++ b/APKToolGUI/ApkTool/Baksmali.cs @@ -0,0 +1,184 @@ +using System; +using Java; +using System.Diagnostics; +using APKToolGUI.Properties; +using System.IO; +using APKToolGUI.Utils; + +namespace APKToolGUI +{ + public class Baksmali : JarProcess, IDisposable + { + private bool disposed = false; + + public new event BaksmaliExitedEventHandler Exited; + + string _jarPath; + public Baksmali(string javaPath, string jarPath) + : base(javaPath, jarPath) + { + _jarPath = jarPath; + base.Exited += Baksmali_Exited; + OutputDataReceived += Baksmali_OutputDataReceived; + ErrorDataReceived += Baksmali_ErrorDataReceived; + } + + BaksmaliDataReceivedEventHandler onBaksmaliOutputDataRecieved; + BaksmaliDataReceivedEventHandler onBaksmaliErrorDataRecieved; + + public event BaksmaliDataReceivedEventHandler BaksmaliOutputDataRecieved + { + add + { + onBaksmaliOutputDataRecieved += value; + } + remove + { + onBaksmaliOutputDataRecieved -= value; + } + } + public event BaksmaliDataReceivedEventHandler BaksmaliErrorDataRecieved + { + add + { + onBaksmaliErrorDataRecieved += value; + } + remove + { + onBaksmaliErrorDataRecieved -= value; + } + } + + + private void Baksmali_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + if (onBaksmaliErrorDataRecieved != null && e.Data != null) + onBaksmaliErrorDataRecieved(this, new BaksmaliDataReceivedEventArgs(e.Data)); + } + + private void Baksmali_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + if (onBaksmaliOutputDataRecieved != null && e.Data != null) + onBaksmaliOutputDataRecieved(this, new BaksmaliDataReceivedEventArgs(e.Data)); + } + + void Baksmali_Exited(object sender, EventArgs e) + { + if (Exited != null) + Exited(this, new BaksmaliExitedEventArgs(ExitCode)); + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("java")) + { + using (process) + { + if (process.Id == Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)Id); + process.Kill(); + } + } + } + } + catch (InvalidOperationException ex) + { + Debug.WriteLine($"[Baksmali] Process already exited: {ex.Message}"); + } + catch (System.ComponentModel.Win32Exception ex) + { + Debug.WriteLine($"[Baksmali] Failed to access process: {ex.Message}"); + } + catch (Exception ex) + { + Debug.WriteLine($"[Baksmali] Failed to cancel process: {ex.Message}"); + } + } + + public int Disassemble(string input, string output) + { + string inputFile = String.Format("\"{0}\"", input); + string keyOutputDir = String.Format("-o \"{0}\"", output); + + string args = String.Format("d {0} {1}", inputFile, keyOutputDir); + + Log.v("Baksmali CMD: " + _jarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + + public new void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected new virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + try + { + Cancel(); + } + catch (Exception ex) + { + Debug.WriteLine($"[Baksmali] Error during disposal: {ex.Message}"); + } + finally + { + base.Dispose(); + } + } + disposed = true; + } + } + + ~Baksmali() + { + Dispose(false); + } + } + + public class BaksmaliExitedEventArgs : EventArgs + { + public BaksmaliExitedEventArgs(int exitCode) + { + ExitCode = exitCode; + } + + public int ExitCode { get; private set; } + } + + public delegate void BaksmaliExitedEventHandler(object sender, BaksmaliExitedEventArgs e); + + public delegate void BaksmaliDataReceivedEventHandler(Object sender, BaksmaliDataReceivedEventArgs e); + + public class BaksmaliDataReceivedEventArgs : EventArgs + { + string message; + + public BaksmaliDataReceivedEventArgs(string _data) + { + message = _data; + } + public String Message + { + get + { + return message; + } + } + } +} diff --git a/APKToolGUI/ApkTool/Signapk.cs b/APKToolGUI/ApkTool/Signapk.cs new file mode 100644 index 0000000..11be4ea --- /dev/null +++ b/APKToolGUI/ApkTool/Signapk.cs @@ -0,0 +1,246 @@ +using System; +using Java; +using System.Diagnostics; +using APKToolGUI.Properties; +using APKToolGUI.Utils; +using System.IO.Packaging; + +namespace APKToolGUI +{ + public class Signapk : JarProcess, IDisposable + { + private bool disposed = false; + + public new event SignapkExitedEventHandler Exited; + + private string lastSourceApk; + private string lastOutApk; + public bool silent; + + SignapkDataReceivedEventHandler onSignapkOutputDataRecieved; + SignapkDataReceivedEventHandler onSignapkErrorDataRecieved; + + public event SignapkDataReceivedEventHandler SignapkOutputDataRecieved + { + add + { + onSignapkOutputDataRecieved += value; + } + remove + { + onSignapkOutputDataRecieved -= value; + } + } + public event SignapkDataReceivedEventHandler SignapkErrorDataRecieved + { + add + { + onSignapkErrorDataRecieved += value; + } + remove + { + onSignapkErrorDataRecieved -= value; + } + } + + string _jarPath; + public Signapk(string javaPath, string jarPath) + : base(javaPath, jarPath) + { + _jarPath = jarPath; + Exited += Signapk_Exited; + OutputDataReceived += Signapk_OutputDataReceived; + ErrorDataReceived += Signapk_ErrorDataReceived; + } + + private void Signapk_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + if (onSignapkErrorDataRecieved != null && e.Data != null) + onSignapkErrorDataRecieved(this, new SignapkDataReceivedEventArgs(e.Data)); + } + + private void Signapk_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + if (onSignapkOutputDataRecieved != null && e.Data != null) + onSignapkOutputDataRecieved(this, new SignapkDataReceivedEventArgs(e.Data)); + } + + private void Signapk_Exited(object sender, EventArgs e) + { + if (Exited != null) + Exited(this, new SignapkExitedEventArgs(base.ExitCode, lastSourceApk, lastOutApk)); + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("java")) + { + using (process) + { + if (process.Id == Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)Id); + process.Kill(); + } + } + } + } + catch (InvalidOperationException ex) + { + Debug.WriteLine($"[Signapk] Process already exited: {ex.Message}"); + } + catch (System.ComponentModel.Win32Exception ex) + { + Debug.WriteLine($"[Signapk] Failed to access process: {ex.Message}"); + } + catch (Exception ex) + { + Debug.WriteLine($"[Signapk] Failed to cancel process: {ex.Message}"); + } + } + + public int Sign(string input, string output) + { + lastSourceApk = input; + lastOutApk = Settings.Default.Sign_OutputDir; + + //--key : pk file | --cert : pem + string key = String.Format("--key \"{0}\" --cert \"{1}\"", Settings.Default.Sign_PrivateKey, Settings.Default.Sign_PublicKey); + if (Settings.Default.Sign_UseKeystoreFile) + { + string keyPassword = String.IsNullOrEmpty(Settings.Default.Sign_KeyPassword) ? Settings.Default.Sign_KeystorePassword : Settings.Default.Sign_KeyPassword; + key = String.Format("--ks \"{0}\" --ks-pass pass:{1} --key-pass pass:{2}", Settings.Default.Sign_KeystoreFilePath, Settings.Default.Sign_KeystorePassword, keyPassword); + } + + string alias = String.Format("--ks-key-alias CERT"); + if (Settings.Default.Sign_SetAlias) + alias = String.Format("--ks-key-alias {0}", Settings.Default.Sign_Alias); + + string outputDir = null; + if (Settings.Default.Sign_UseOutputDir || !Settings.Default.Sign_OverwriteInputFile) + outputDir = String.Format("--out \"{0}\"", output); + + string v1 = null; + if (Settings.Default.Sign_Schemev1 == 1) + v1 = "--v1-signing-enabled true"; + if (Settings.Default.Sign_Schemev1 == 2) + v1 = "--v1-signing-enabled false"; + + string v2 = null; + if (Settings.Default.Sign_Schemev2 == 1) + v2 = "--v2-signing-enabled true"; + if (Settings.Default.Sign_Schemev2 == 2) + v2 = "--v2-signing-enabled false"; + + string v3 = null; + if (Settings.Default.Sign_Schemev3 == 1) + v3 = "--v3-signing-enabled true"; + if (Settings.Default.Sign_Schemev3 == 2) + v3 = "--v3-signing-enabled false"; + + string v4 = null; + if (Settings.Default.Sign_Schemev4 == 1) + v4 = "--v4-signing-enabled true"; + if (Settings.Default.Sign_Schemev4 == 2) + v4 = "--v4-signing-enabled false"; + + string args = String.Format("sign {0} {1} {2} {3} {4} {5} {6} \"{7}\"", key, alias, v1, v2, v3, v4, outputDir, lastSourceApk); + + Log.v("Signapk CMD: " + _jarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + + public string GetSignature(string apkFile) + { + using (JarProcess apktoolJar = new JarProcess(JavaPath, JarPath)) + { + apktoolJar.EnableRaisingEvents = false; + apktoolJar.Start($"verify --print-certs \"{apkFile}\""); + string version = apktoolJar.StandardOutput.ReadToEnd(); + version += apktoolJar.StandardError.ReadToEnd(); + apktoolJar.WaitForExit(); + return version; + } + } + + public new void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected new virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + try + { + Cancel(); + } + catch (Exception ex) + { + Debug.WriteLine($"[Signapk] Error during disposal: {ex.Message}"); + } + finally + { + base.Dispose(); + } + } + disposed = true; + } + } + + ~Signapk() + { + Dispose(false); + } + } + + public delegate void SignapkExitedEventHandler(object sender, SignapkExitedEventArgs e); + + public class SignapkExitedEventArgs : EventArgs + { + public SignapkExitedEventArgs(int exitCode, string sourceFilePath, string outFilePath) + { + ExitCode = exitCode; + SourceFilePath = sourceFilePath; + OutFilePath = outFilePath; + } + + public int ExitCode { get; private set; } + + public string SourceFilePath { get; private set; } + + public string OutFilePath { get; private set; } + } + + public delegate void SignapkDataReceivedEventHandler(Object sender, SignapkDataReceivedEventArgs e); + + public class SignapkDataReceivedEventArgs : EventArgs + { + string message; + + public SignapkDataReceivedEventArgs(string _data) + { + message = _data; + } + public String Message + { + get + { + return message; + } + } + } +} diff --git a/APKToolGUI/ApkTool/Smali.cs b/APKToolGUI/ApkTool/Smali.cs new file mode 100644 index 0000000..d67932c --- /dev/null +++ b/APKToolGUI/ApkTool/Smali.cs @@ -0,0 +1,181 @@ +using System; +using Java; +using System.Diagnostics; +using APKToolGUI.Properties; +using System.IO; +using APKToolGUI.Utils; + +namespace APKToolGUI +{ + public class Smali : JarProcess, IDisposable + { + private bool disposed = false; + + public new event SmaliExitedEventHandler Exited; + + string _jarPath; + public Smali(string javaPath, string jarPath) + : base(javaPath, jarPath) + { + _jarPath = jarPath; + base.Exited += Smali_Exited; + } + + SmaliDataReceivedEventHandler onSmaliOutputDataRecieved; + SmaliDataReceivedEventHandler onSmaliErrorDataRecieved; + + public event SmaliDataReceivedEventHandler SmaliOutputDataRecieved + { + add + { + onSmaliOutputDataRecieved += value; + } + remove + { + onSmaliOutputDataRecieved -= value; + } + } + public event SmaliDataReceivedEventHandler SmaliErrorDataRecieved + { + add + { + onSmaliErrorDataRecieved += value; + } + remove + { + onSmaliErrorDataRecieved -= value; + } + } + + + private void Smali_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + if (onSmaliErrorDataRecieved != null && e.Data != null) + onSmaliErrorDataRecieved(this, new SmaliDataReceivedEventArgs(e.Data)); + } + + private void Smali_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + if (onSmaliOutputDataRecieved != null && e.Data != null) + onSmaliOutputDataRecieved(this, new SmaliDataReceivedEventArgs(e.Data)); + } + void Smali_Exited(object sender, EventArgs e) + { + if (Exited != null) + Exited(this, new SmaliExitedEventArgs(ExitCode)); + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("java")) + { + using (process) + { + if (process.Id == Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)Id); + process.Kill(); + } + } + } + } + catch (InvalidOperationException ex) + { + Debug.WriteLine($"[Smali] Process already exited: {ex.Message}"); + } + catch (System.ComponentModel.Win32Exception ex) + { + Debug.WriteLine($"[Smali] Failed to access process: {ex.Message}"); + } + catch (Exception ex) + { + Debug.WriteLine($"[Smali] Failed to cancel process: {ex.Message}"); + } + } + + public int Assemble(string input, string output) + { + string inputFile = String.Format("\"{0}\"", input); + string keyOutputDir = String.Format("-o \"{0}\"", output); + + string args = String.Format("a {0} {1}", inputFile, keyOutputDir); + + Log.v("Smali CMD: " + _jarPath + " " + args); + + Start(args); + BeginOutputReadLine(); + BeginErrorReadLine(); + WaitForExit(); + CancelOutputRead(); + CancelErrorRead(); + return ExitCode; + } + + public new void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected new virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + try + { + Cancel(); + } + catch (Exception ex) + { + Debug.WriteLine($"[Smali] Error during disposal: {ex.Message}"); + } + finally + { + base.Dispose(); + } + } + disposed = true; + } + } + + ~Smali() + { + Dispose(false); + } + } + + public class SmaliExitedEventArgs : EventArgs + { + public SmaliExitedEventArgs(int exitCode) + { + ExitCode = exitCode; + } + + public int ExitCode { get; private set; } + } + + public delegate void SmaliExitedEventHandler(object sender, SmaliExitedEventArgs e); + + public delegate void SmaliDataReceivedEventHandler(Object sender, SmaliDataReceivedEventArgs e); + + public class SmaliDataReceivedEventArgs : EventArgs + { + string message; + + public SmaliDataReceivedEventArgs(string _data) + { + message = _data; + } + public String Message + { + get + { + return message; + } + } + } +} diff --git a/APKToolGUI/ApkTool/Zipalign.cs b/APKToolGUI/ApkTool/Zipalign.cs new file mode 100644 index 0000000..2a84b63 --- /dev/null +++ b/APKToolGUI/ApkTool/Zipalign.cs @@ -0,0 +1,216 @@ +using APKToolGUI.Properties; +using APKToolGUI.Utils; +using System; +using System.Diagnostics; +using System.IO; + +namespace APKToolGUI +{ + public class Zipalign : IDisposable + { + Process processZipalign; + private bool disposed = false; + + static class Keys + { + public const string CheckOnly = " -c"; + public const string OverwriteOutputFile = " -f"; + public const string VerboseOut = " -v"; + public const string Recompress = " -z"; + } + + public event DataReceivedEventHandler OutputDataReceived + { + add { processZipalign.OutputDataReceived += value; } + remove { processZipalign.OutputDataReceived -= value; } + } + public event DataReceivedEventHandler ErrorDataReceived + { + add { processZipalign.ErrorDataReceived += value; } + remove { processZipalign.ErrorDataReceived -= value; } + } + public event EventHandler Exited; + public int ExitCode { get { return processZipalign.ExitCode; } } + + string _zipalignFileName; + public Zipalign(string zipalignFileName) + { + _zipalignFileName = zipalignFileName; + processZipalign = new Process(); + processZipalign.EnableRaisingEvents = true; + processZipalign.StartInfo.FileName = zipalignFileName; + processZipalign.StartInfo.UseShellExecute = false; // Disable shell execution to read output data + processZipalign.StartInfo.RedirectStandardOutput = true; // Allow output redirection + processZipalign.StartInfo.RedirectStandardError = true; // Allow error redirection + processZipalign.StartInfo.CreateNoWindow = true; // Do not create window for the launched program + processZipalign.Exited += processZipalign_Exited; + } + + void processZipalign_Exited(object sender, EventArgs e) + { + processZipalign.CancelOutputRead(); + processZipalign.CancelErrorRead(); + if (this.Exited != null) + Exited(this, new EventArgs()); + } + + public void Cancel() + { + try + { + foreach (var process in Process.GetProcessesByName("zipalign")) + { + using (process) + { + if (process.Id == processZipalign.Id) + { + ProcessUtils.KillAllProcessesSpawnedBy((uint)processZipalign.Id); + process.Kill(); + } + } + } + } + catch (Exception ex) + { + Debug.WriteLine($"[Zipalign] Cancel failed: {ex.Message}"); + // Process termination failure is not critical, so continue + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + if (processZipalign != null) + { + try + { + if (!processZipalign.HasExited) + { + processZipalign.Kill(); + } + } + catch (Exception ex) + { + Debug.WriteLine($"[Zipalign] Error disposing process: {ex.Message}"); + } + finally + { + processZipalign.Dispose(); + processZipalign = null; + } + } + } + disposed = true; + } + } + + ~Zipalign() + { + Dispose(false); + } + + public int Align(string input, string output) + { + string keyCheckOnly = null, keyVerbose = null, keyRecompress = null, keyOverwriteOutputFile = null, keyOutputFile = null; + + if (Settings.Default.Zipalign_Verbose) + keyVerbose = Keys.VerboseOut; + if (Settings.Default.Zipalign_CheckOnly) + { + keyCheckOnly = Keys.CheckOnly; + } + else + { + if (Settings.Default.Zipalign_Recompress) + keyRecompress = Keys.Recompress; + if (Settings.Default.Zipalign_OverwriteOutputFile) + { + keyOverwriteOutputFile = Keys.OverwriteOutputFile; + } + //if (Settings.Default.Zipalign_OverwriteOutputFile) + keyOutputFile = String.Format(" \"{0}\"", PathUtils.GetDirectoryNameWithoutExtension(output) + "_align_temp.apk"); + //else + // keyOutputFile = String.Format(" \"{0}\"", output); + } + + string args = String.Format("{0}{1}{2}{3} {4} \"{5}\" {6}", keyCheckOnly, keyOverwriteOutputFile, keyVerbose, keyRecompress, Settings.Default.Zipalign_AlignmentInBytes, input, keyOutputFile); + + Log.v("Zipalign: " + _zipalignFileName + " " + args); + + processZipalign.StartInfo.Arguments = args; + processZipalign.Start(); + processZipalign.BeginOutputReadLine(); + processZipalign.BeginErrorReadLine(); + processZipalign.WaitForExit(); + + // Handle temp file (only when not in CheckOnly mode) + if (!Settings.Default.Zipalign_CheckOnly) + { + string tempFile = PathUtils.GetDirectoryNameWithoutExtension(output) + "_align_temp.apk"; + + try + { + // 1. Delete output file + if (File.Exists(output)) + { + File.Delete(output); + Debug.WriteLine($"[Zipalign] Deleted existing output: {output}"); + } + + // 2. Check temp file existence and move + if (File.Exists(tempFile)) + { + File.Move(tempFile, output); + Debug.WriteLine($"[Zipalign] Moved temp file to output: {tempFile} -> {output}"); + } + else + { + Debug.WriteLine($"[Zipalign] Warning: Temp file not found: {tempFile}"); + return 1; // Return failure code + } + } + catch (IOException ex) + { + Debug.WriteLine($"[Zipalign] Failed to process output file: {ex.Message}"); + + // Attempt to cleanup temp file + try + { + if (File.Exists(tempFile)) + { + File.Delete(tempFile); + Debug.WriteLine($"[Zipalign] Cleaned up temp file: {tempFile}"); + } + } + catch (Exception cleanupEx) + { + Debug.WriteLine($"[Zipalign] Failed to cleanup temp file: {cleanupEx.Message}"); + } + + return 1; + } + catch (UnauthorizedAccessException ex) + { + Debug.WriteLine($"[Zipalign] Access denied: {ex.Message}"); + return 1; + } + catch (Exception ex) + { + Debug.WriteLine($"[Zipalign] Unexpected error processing output: {ex.Message}"); + return 1; + } + } + + return ExitCode; + } + } +} diff --git a/APKToolGUI/Apktool.cs b/APKToolGUI/Apktool.cs deleted file mode 100644 index 0b4f055..0000000 --- a/APKToolGUI/Apktool.cs +++ /dev/null @@ -1,554 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text.RegularExpressions; -using Java; - -namespace APKToolGUI -{ - public class Apktool : JarProcess - { - enum ApktoolActionType - { - Decompile, - Build, - InstallFramework, - Null - } - static class DecompileKeys - { - public const string NoSource = " -s"; - public const string NoResource = " -r"; - public const string Force = " -f"; - public const string FrameworkPath = " -p"; - public const string KeepBrokenResource = " -k"; - public const string MatchOriginal = " -m"; - public const string OutputDir = " -o"; - } - static class BuildKeys - { - public const string ForceAll = " -f"; - public const string CopyOriginal = " -c"; - public const string Aapt = " -a"; - public const string FrameworkPath = " -p"; - public const string OutputAppPath = " -o"; - } - static class InstallFrameworkKeys - { - public const string FrameDir = " -p"; - public const string Tag = " -t"; - } - ApktoolActionType lastActionType = ApktoolActionType.Null; - string lastFilePath; - string lastProjectDir; - ApktoolDataReceivedEventHandler onApktoolOutputDataRecieved; - ApktoolDataReceivedEventHandler onApktoolErrorDataRecieved; - ApktoolEventCompletedEventHandler onBuildCompleted; - ApktoolEventCompletedEventHandler onDecompilingCompleted; - ApktoolEventCompletedEventHandler onInstallFrameworkCompleted; - - public event ApktoolDataReceivedEventHandler ApktoolOutputDataRecieved - { - add - { - onApktoolOutputDataRecieved += value; - } - remove - { - onApktoolOutputDataRecieved -= value; - } - } - public event ApktoolDataReceivedEventHandler ApktoolErrorDataRecieved - { - add - { - onApktoolErrorDataRecieved += value; - } - remove - { - onApktoolErrorDataRecieved -= value; - } - } - - public event ApktoolEventCompletedEventHandler BuildCompleted - { - add - { - onBuildCompleted += value; - } - remove - { - onBuildCompleted -= value; - } - } - public event ApktoolEventCompletedEventHandler DecompilingCompleted - { - add - { - onDecompilingCompleted += value; - } - remove - { - onDecompilingCompleted -= value; - } - } - public event ApktoolEventCompletedEventHandler InstallFrameworkCompleted - { - add - { - onInstallFrameworkCompleted += value; - } - remove - { - onInstallFrameworkCompleted -= value; - } - } - - public Apktool(string javaPath, string jarPath) : base(javaPath, jarPath) - { - this.Exited += Apktool_Exited; - this.OutputDataReceived += Apktool_OutputDataReceived; - this.ErrorDataReceived += Apktool_ErrorDataReceived; - } - - private void Apktool_ErrorDataReceived(object sender, DataReceivedEventArgs e) - { - if (onApktoolErrorDataRecieved != null && e.Data != null) - onApktoolErrorDataRecieved(this, new ApktoolDataReceivedEventArgs(e.Data)); - } - - private void Apktool_OutputDataReceived(object sender, DataReceivedEventArgs e) - { - if (onApktoolOutputDataRecieved != null && e.Data != null) - onApktoolOutputDataRecieved(this, new ApktoolDataReceivedEventArgs(e.Data)); - } - - private void Apktool_Exited(object sender, EventArgs e) - { - this.CancelOutputRead(); - this.CancelErrorRead(); - switch (lastActionType) - { - case ApktoolActionType.Build: - if (onBuildCompleted != null) - onBuildCompleted(this, new ApktoolEventCompletedEventArgs(this.ExitCode, lastFilePath, lastProjectDir)); - lastActionType = ApktoolActionType.Null; - break; - case ApktoolActionType.Decompile: - if (onDecompilingCompleted != null) - onDecompilingCompleted(this, new ApktoolEventCompletedEventArgs(this.ExitCode, lastFilePath, lastProjectDir)); - lastActionType = ApktoolActionType.Null; - break; - case ApktoolActionType.InstallFramework: - if (onInstallFrameworkCompleted != null) - onInstallFrameworkCompleted(this, new ApktoolEventCompletedEventArgs(this.ExitCode, lastFilePath, lastProjectDir)); - lastActionType = ApktoolActionType.Null; - break; - case ApktoolActionType.Null: - break; - default: - break; - } - } - - public bool Decompile(DecompileOptions options) - { - lastActionType = ApktoolActionType.Decompile; - lastFilePath = options.AppPath; - lastProjectDir = options.OutputDirectory; - - string keyNoSrc = null, keyNoRes = null, keyForce = null, keyFramePath = null, keyKeepBrokenRes = null, keyMatchOriginal = null, keyOutputDir = null; - - if (options.NoSource) - keyNoSrc = DecompileKeys.NoSource; - if (options.NoResource) - keyNoRes = DecompileKeys.NoResource; - if (options.Force) - keyForce = DecompileKeys.Force; - if (options.KeepBrokenResource) - keyKeepBrokenRes = DecompileKeys.KeepBrokenResource; - if (options.MatchOriginal) - keyMatchOriginal = DecompileKeys.MatchOriginal; - if (!String.IsNullOrWhiteSpace(options.FrameworkPath)) - keyFramePath = String.Format("{0} \"{1}\"", DecompileKeys.FrameworkPath, options.FrameworkPath); - if (!String.IsNullOrWhiteSpace(options.OutputDirectory)) - keyOutputDir = String.Format("{0} \"{1}\"", DecompileKeys.OutputDir, options.OutputDirectory); - - //string args = String.Format("d{0}{1}{2}{3}{4}{5} -o \"{6}\" \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, options.ProjectDirectory, options.AppPath); - string args = String.Format("d{0}{1}{2}{3}{4}{5}{6} \"{7}\"", keyNoSrc, keyNoRes, keyForce, keyKeepBrokenRes, keyMatchOriginal, keyFramePath, keyOutputDir, options.AppPath); - - bool started = this.Start(args); - this.BeginOutputReadLine(); - this.BeginErrorReadLine(); - return started; - } - - public bool Build(BuildOptions options) - { - lastActionType = ApktoolActionType.Build; - lastFilePath = options.AppPath; - lastProjectDir = options.ProjectDirectory; - - string keyForceAll = null, keyAapt = null, keyCopyOriginal = null, keyFramePath = null, keyOutputAppPath = null; - if (options.ForceAll) - keyForceAll = BuildKeys.ForceAll; - if (options.CopyOriginal) - keyCopyOriginal = BuildKeys.CopyOriginal; - if (!String.IsNullOrEmpty(options.AaptPath)) - keyAapt = String.Format("{0} \"{1}\"", BuildKeys.Aapt, options.AaptPath); - if (!String.IsNullOrEmpty(options.FrameworkPath)) - keyFramePath = String.Format("{0} \"{1}\"", BuildKeys.FrameworkPath, options.FrameworkPath); - if (!String.IsNullOrWhiteSpace(options.AppPath)) - keyOutputAppPath = String.Format("{0} \"{1}\"", BuildKeys.OutputAppPath, options.AppPath); - - string args = String.Format("b{0}{1}{2}{3}{4} \"{5}\"", keyForceAll, keyAapt, keyCopyOriginal, keyFramePath, keyOutputAppPath, options.ProjectDirectory); - - bool started = this.Start(args); - this.BeginOutputReadLine(); - this.BeginErrorReadLine(); - return started; - } - - public bool InstallFramework(InstallFrameworkOptions options) - { - lastActionType = ApktoolActionType.InstallFramework; - lastFilePath = options.InputFramePath; - lastProjectDir = null; - - string keyFrameDir = null, keyTag = null; - - if (!String.IsNullOrWhiteSpace(options.FrameDir)) - keyFrameDir = String.Format("{0} \"{1}\"", InstallFrameworkKeys.FrameDir, options.FrameDir); - if (!String.IsNullOrWhiteSpace(options.Tag)) - keyTag = String.Format("{0} \"{1}\"", InstallFrameworkKeys.Tag, options.Tag); - - string args = String.Format("if{0}{1} \"{2}\"", keyFrameDir, keyTag, options.InputFramePath); - - bool started = this.Start(args); - this.BeginOutputReadLine(); - this.BeginErrorReadLine(); - return started; - } - - public string GetVersion() - { - using (JarProcess apktoolJar = new JarProcess(this.JavaPath, this.JarPath)) - { - apktoolJar.EnableRaisingEvents = false; - apktoolJar.Start("-version"); - string version = apktoolJar.StandardOutput.ReadToEnd(); - apktoolJar.WaitForExit(3000); - return version; - } - } - - private static ApktoolEventType GetEventType(string message) - { - MatchCollection mCol = Regex.Matches(message, @"^(\w+):\s(.+)$"); - if (mCol.Count > 0) - { - switch (mCol[0].Groups[1].Value) - { - case "W": - return ApktoolEventType.Warning; - case "Warning": - return ApktoolEventType.Warning; - case "I": - return ApktoolEventType.Information; - case "Error": - return ApktoolEventType.Error; - case "E": - return ApktoolEventType.Error; - default: - return ApktoolEventType.Unknown; - } - } - else - return ApktoolEventType.Unknown; - } - } - - public delegate void ApktoolEventCompletedEventHandler(Object sender, ApktoolEventCompletedEventArgs e); - - public class ApktoolEventCompletedEventArgs : EventArgs - { - private int _exitCode; - private string _filePath; - private string _projectDir; - - public ApktoolEventCompletedEventArgs(int exitCode, string filePath, string projectDir) - { - _exitCode = exitCode; - _filePath = filePath; - _projectDir = projectDir; - } - - public int ExitCode - { - get - { - return _exitCode; - } - } - public string FilePath - { - get - { - return _filePath; - } - } - public string ProjectDir - { - get - { - return _projectDir; - } - } - } - - public delegate void ApktoolDataReceivedEventHandler(Object sender, ApktoolDataReceivedEventArgs e); - - public class ApktoolDataReceivedEventArgs : EventArgs - { - string data; - string message; - ApktoolEventType eventType; - - public ApktoolDataReceivedEventArgs(string data) - { - this.data = data; - SetData(); - } - public String Message{ - get{ - return message;}} - public ApktoolEventType EventType{ - get{ - return eventType;}} - - private void SetData() - { - MatchCollection mCol = Regex.Matches(data, @"^(\w+):\s(.+)$"); - if (mCol.Count > 0) - { - switch (mCol[0].Groups[1].Value) - { - case "W": - eventType = ApktoolEventType.Warning; - message = mCol[0].Groups[2].Value; - break; - case "Warning": - eventType = ApktoolEventType.Warning; - message = mCol[0].Groups[2].Value; - break; - case "I": - eventType = ApktoolEventType.Information; - message = mCol[0].Groups[2].Value; - break; - case "Error": - eventType = ApktoolEventType.Error; - message = mCol[0].Groups[2].Value; - break; - case "E": - eventType = ApktoolEventType.Error; - message = mCol[0].Groups[2].Value; - break; - default: - eventType = ApktoolEventType.Unknown; - message = data; - break; - } - } - else - { - eventType = ApktoolEventType.Unknown; - message = data; - } - } - } - - public enum ApktoolEventType - { - Information, - Warning, - Error, - Unknown - } - - public class BuildOptions - { - public BuildOptions(string projectDir) - { - this.ProjectDirectory = projectDir; - } - //public BuildOptions(string projectDir, string apkPath) - //{ - // this.ProjectDirectory = projectDir; - // this.AppPath = apkPath; - //} - public string ProjectDirectory { get; set; } - /// - /// The name of apk that gets written. - /// - public string AppPath { get; set; } - /// - /// Loads aapt from specified location. - /// - public string AaptPath { get; set; } - /// - /// Skip changes detection and build all files. - /// - public bool ForceAll { get; set; } - /// - /// Copies original AndroidManifest.xml and META-INF. - /// - public bool CopyOriginal { get; set; } - /// - /// Uses framework files located in dir. - /// - public string FrameworkPath { get; set; } - } - - public class DecompileOptions - { - public DecompileOptions(string apkPath) - { - this.AppPath = apkPath; - this.OutputDirectory = String.Format("{0}\\{1}", System.IO.Path.GetDirectoryName(apkPath), System.IO.Path.GetFileNameWithoutExtension(apkPath)); - } - /// - /// The name of folder that gets written. - /// - public string OutputDirectory { get; set; } - public string AppPath { get; set; } - /// - /// Do not decode sources. - /// - public bool NoSource { get; set; } - /// - /// Do not decode resources. - /// - public bool NoResource { get; set; } - /// - /// Force delete destination directory. - /// - public bool Force { get; set; } - /// - /// Uses framework files located in dir. - /// - public string FrameworkPath { get; set; } - /// - /// Use if there was an error and some resourceswere dropped, e.g."Invalid config flags detected. Dropping resources", - /// but you want to decode them anyway, even with errors. You will have to fix them manually before building. - /// - public bool KeepBrokenResource { get; set; } - /// - /// Keeps files to closest to original as possible. Prevents rebuild. - /// - public bool MatchOriginal { get; set; } - } - - public class InstallFrameworkOptions - { - public InstallFrameworkOptions(string framePath) - { - this.InputFramePath = framePath; - } - public string InputFramePath { get; set; } - /// - /// Stores framework files into directory - /// - public string FrameDir { get; set; } - /// - /// Frameworks tag - /// - public string Tag { get; set; } - } - - //public class ApktoolMessage - //{ - // public ApktoolEventType EventType { get; private set; } - // public string Message { get; private set; } - // private string data; - - // public ApktoolMessage(string data) - // { - // this.data = data; - // SetData(); - // } - - // private void SetData() - // { - // MatchCollection mCol = Regex.Matches(data, @"^(\w+):\s(.+)$"); - // if (mCol.Count > 0) - // { - // switch (mCol[0].Groups[1].Value) - // { - // case "W": - // this.EventType = ApktoolEventType.Warning; - // this.Message = mCol[0].Groups[2].Value; - // break; - // case "Warning": - // this.EventType = ApktoolEventType.Warning; - // this.Message = mCol[0].Groups[2].Value; - // break; - // case "I": - // this.EventType = ApktoolEventType.Information; - // this.Message = mCol[0].Groups[2].Value; - // break; - // case "Error": - // this.EventType = ApktoolEventType.Error; - // this.Message = mCol[0].Groups[2].Value; - // break; - // case "E": - // this.EventType = ApktoolEventType.Error; - // this.Message = mCol[0].Groups[2].Value; - // break; - // default: - // this.EventType = ApktoolEventType.Unknown; - // this.Message = data; - // break; - // } - // } - // else - // { - // this.EventType = ApktoolEventType.Unknown; - // this.Message = data; - // } - // } - - // public static ApktoolEventType GetEventType(string data) - // { - // MatchCollection mCol = Regex.Matches(data, @"^(\w+):\s(.+)$"); - // if (mCol.Count > 0) - // { - // switch (mCol[0].Groups[1].Value) - // { - // case "W": - // return ApktoolEventType.Warning; - // case "Warning": - // return ApktoolEventType.Warning; - // case "I": - // return ApktoolEventType.Information; - // case "Error": - // return ApktoolEventType.Error; - // case "E": - // return ApktoolEventType.Error; - // default: - // return ApktoolEventType.Unknown; - // } - // } - // else - // return ApktoolEventType.Unknown; - // } - - // public static string GetMessage(string data) - // { - // MatchCollection mCol = Regex.Matches(data, @"^(\w+):\s(.+)$"); - // if (mCol.Count > 0) - // return mCol[0].Groups[2].Value; - // else - // return data; - // } - //} -} diff --git a/APKToolGUI/Controls/LogView.cs b/APKToolGUI/Controls/LogView.cs new file mode 100644 index 0000000..682719b --- /dev/null +++ b/APKToolGUI/Controls/LogView.cs @@ -0,0 +1,989 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Media; + +namespace APKToolGUI.Controls +{ + /// + /// A virtualized, monospace, console-style log view that replaces the old . + /// + /// Why it exists: RichTextBox renders a FlowDocument, which is NOT UI-virtualized — every line is a live + /// layout element and any change re-measures the whole document on the UI thread (O(total lines)), which + /// froze the GUI once the log held thousands of lines. This control keeps lines in a ring buffer and only + /// draws the visual rows currently on screen (OnRender + FormattedText), so cost is O(visible). + /// + /// Monospace (Consolas) makes the geometry trivial: column = (x - padding) / charWidth, and the word-wrap + /// column is just viewportWidth / charWidth. Word wrap turns one logical line into several "visual rows"; + /// selection is stored in logical (line, column) coordinates so it survives re-wrapping on resize. + /// + /// It implements so a host (CanContentScroll=True) + /// drives scrolling and the scrollbars. + /// + public sealed class LogView : FrameworkElement, IScrollInfo + { + /// One coloured (optionally clickable) run of text within a line. + public sealed class Segment + { + public string Text; + public Brush Foreground; + public bool Bold; + public Action OnClick; // null => plain text; non-null => hyperlink + + public Segment(string text, Brush foreground = null, bool bold = false, Action onClick = null) + { + Text = text ?? string.Empty; + Foreground = foreground; + Bold = bold; + OnClick = onClick; + } + } + + private sealed class Line + { + public readonly Segment[] Segments; + public readonly int Length; // total character count across segments + + // Wrap cache: start column of each visual row, for the wrap width it was computed at. + public int[] RowStarts; + public int WrapCols = int.MinValue; + + public Line(Segment[] segments) + { + Segments = segments; + int len = 0; + for (int i = 0; i < segments.Length; i++) + len += segments[i].Text.Length; + Length = len; + } + + public string GetText() + { + if (Segments.Length == 1) + return Segments[0].Text; + StringBuilder sb = new StringBuilder(Length); + for (int i = 0; i < Segments.Length; i++) + sb.Append(Segments[i].Text); + return sb.ToString(); + } + } + + // Bounded scrollback. Lines are trimmed from the front once the buffer grows past MaxLines + TrimSlack, + // in one bulk RemoveRange so trimming is amortised O(1) per line. + public const int MaxLines = 32767; + private const int TrimSlack = 4096; + + // Tab stop width in characters. Tabs are expanded to spaces on input so the buffer is truly fixed-width + // (a raw '\t' renders as a wide gap that desyncs the charWidth-based geometry). 8 matches the tab stops + // the existing log strings were authored for (e.g. AaptParser's "App name:\t\t" → column 24). + private const int TabSize = 8; + + private const double LeftPadding = 3.0; + private static readonly int[] SingleRow = new int[] { 0 }; + + private readonly List _lines = new List(); + + // Wrap/visual-row layout (rebuilt lazily; kept live incrementally on append). + private bool _wrapText = true; + private readonly List _rowOffsets = new List(); // _rowOffsets[i] = visual rows before line i + private int _totalRows; + private int _maxLineLen; + private bool _layoutBuilt; + private bool _layoutDirty; + private int _layoutWrapCols = int.MinValue; + private readonly List _wrapScratch = new List(); + + // Cached font metrics (recomputed when font/dpi changes). Monospace => one char width fits all. + private Typeface _typeface; + private Typeface _boldTypeface; + private double _charWidth; + private double _lineHeight; + private double _pixelsPerDip = 1.0; + private bool _metricsValid; + + // Selection, expressed as (line, column) caret positions. Anchor is where the drag began. + private struct Pos + { + public int Line; + public int Col; + public Pos(int line, int col) { Line = line; Col = col; } + public int CompareTo(Pos o) + { + if (Line != o.Line) return Line < o.Line ? -1 : 1; + if (Col != o.Col) return Col < o.Col ? -1 : 1; + return 0; + } + } + + private Pos _selAnchor; + private Pos _selCaret; + private bool _hasSelection; + private bool _selecting; // mouse drag in progress + private Point _mouseDownPoint; // to distinguish click from drag (hyperlinks) + + // One active search highlight (logical line/col/length), or _searchLine < 0 for none. + private int _searchLine = -1; + private int _searchCol; + private int _searchLen; + + // Auto-scroll: stay pinned to the bottom unless the user scrolls up. + private bool _stickToBottom = true; + + private static readonly Brush SelectionBrush = new SolidColorBrush(Color.FromArgb(120, 51, 153, 255)); + private static readonly Brush SearchBrush = new SolidColorBrush(Color.FromRgb(38, 79, 120)); + private static readonly Brush LinkBrush = new SolidColorBrush(Color.FromRgb(60, 166, 255)); // old #FF3CA6FF + + static LogView() + { + SelectionBrush.Freeze(); + SearchBrush.Freeze(); + LinkBrush.Freeze(); + } + + public LogView() + { + Focusable = true; + ClipToBounds = true; + Cursor = Cursors.IBeam; + TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display); + SnapsToDevicePixels = true; + FocusVisualStyle = null; + + // Routed commands so Ctrl+C / Ctrl+A work via the command system (in addition to OnKeyDown), + // and so the context menu items can bind to them and show their gestures. + CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, + (s, e) => { CopySelection(); e.Handled = true; }, + (s, e) => { e.CanExecute = HasSelection; })); + CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, + (s, e) => { SelectAll(); e.Handled = true; }, + (s, e) => { e.CanExecute = _lines.Count > 0; })); + + BuildContextMenu(); + } + + private void BuildContextMenu() + { + ContextMenu menu = new ContextMenu(); + + MenuItem copy = new MenuItem { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = this }; + MenuItem copyAll = new MenuItem { Header = "Copy all" }; + copyAll.Click += (s, e) => CopyAll(); + MenuItem selectAll = new MenuItem { Header = "Select all", Command = ApplicationCommands.SelectAll, CommandTarget = this }; + + menu.Items.Add(copy); + menu.Items.Add(copyAll); + menu.Items.Add(new Separator()); + menu.Items.Add(selectAll); + ContextMenu = menu; + } + + /// When true (default), long lines wrap to the viewport width; when false they're one row each. + public bool WrapText + { + get { return _wrapText; } + set + { + if (_wrapText == value) return; + _wrapText = value; + _canHScroll = !value; + _layoutDirty = true; + InvalidateMeasure(); + InvalidateVisual(); + } + } + + #region Appearance dependency properties + + public static readonly DependencyProperty FontFamilyProperty = DependencyProperty.Register( + nameof(FontFamily), typeof(FontFamily), typeof(LogView), + new FrameworkPropertyMetadata(new FontFamily("Consolas"), + FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, + OnFontChanged)); + + public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register( + nameof(FontSize), typeof(double), typeof(LogView), + new FrameworkPropertyMetadata(13.0, + FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, + OnFontChanged)); + + public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register( + nameof(Foreground), typeof(Brush), typeof(LogView), + new FrameworkPropertyMetadata(Brushes.White, FrameworkPropertyMetadataOptions.AffectsRender)); + + public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register( + nameof(Background), typeof(Brush), typeof(LogView), + new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender)); + + public FontFamily FontFamily { get { return (FontFamily)GetValue(FontFamilyProperty); } set { SetValue(FontFamilyProperty, value); } } + public double FontSize { get { return (double)GetValue(FontSizeProperty); } set { SetValue(FontSizeProperty, value); } } + public Brush Foreground { get { return (Brush)GetValue(ForegroundProperty); } set { SetValue(ForegroundProperty, value); } } + public Brush Background { get { return (Brush)GetValue(BackgroundProperty); } set { SetValue(BackgroundProperty, value); } } + + private static void OnFontChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + LogView v = (LogView)d; + v._metricsValid = false; + v._layoutDirty = true; + } + + #endregion + + #region Metrics + + private void EnsureMetrics() + { + if (_metricsValid) + return; + + FontFamily family = FontFamily ?? new FontFamily("Consolas"); + _typeface = new Typeface(family, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); + _boldTypeface = new Typeface(family, FontStyles.Normal, FontWeights.Bold, FontStretches.Normal); + + try { _pixelsPerDip = VisualTreeHelper.GetDpi(this).PixelsPerDip; } + catch { _pixelsPerDip = 1.0; } + + FormattedText probe = MakeText("0", _typeface, Brushes.White); + _charWidth = probe.WidthIncludingTrailingWhitespace; + if (_charWidth <= 0) _charWidth = FontSize * 0.6; + _lineHeight = Math.Ceiling(probe.Height); + if (_lineHeight <= 0) _lineHeight = Math.Ceiling(FontSize * 1.4); + + _metricsValid = true; + } + + private FormattedText MakeText(string text, Typeface tf, Brush brush) + { + return new FormattedText(text, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, + tf, FontSize, brush ?? Foreground ?? Brushes.White, _pixelsPerDip); + } + + #endregion + + #region Wrap / visual-row layout + + private int ComputeWrapCols() + { + if (!_wrapText || _charWidth <= 0) + return int.MaxValue; // one row per line + double avail = _viewport.Width - LeftPadding * 2; + if (avail < _charWidth) + return _viewport.Width <= 0 ? int.MaxValue : 1; + return Math.Max(1, (int)Math.Floor(avail / _charWidth)); + } + + private int[] WrapLine(Line line, int wrapCols) + { + if (wrapCols <= 0 || line.Length <= wrapCols) + return SingleRow; + + string t = line.GetText(); + int n = t.Length; + List rows = _wrapScratch; + rows.Clear(); + rows.Add(0); + int pos = 0; + while (pos + wrapCols < n) + { + int limit = pos + wrapCols; + int br = -1; + for (int k = limit; k > pos; k--) + if (t[k] == ' ') { br = k; break; } + + int next = (br > pos) ? br + 1 : limit; // break after the space, else hard break + if (next <= pos) next = pos + 1; + rows.Add(next); + pos = next; + } + return rows.ToArray(); + } + + private void EnsureWrapped(Line line, int wrapCols) + { + if (line.RowStarts != null && line.WrapCols == wrapCols) + return; + line.RowStarts = WrapLine(line, wrapCols); + line.WrapCols = wrapCols; + } + + private void EnsureLayout() + { + EnsureMetrics(); + int wrapCols = ComputeWrapCols(); + if (_layoutBuilt && !_layoutDirty && wrapCols == _layoutWrapCols) + return; + + _rowOffsets.Clear(); + int total = 0; + int maxLen = 0; + for (int i = 0; i < _lines.Count; i++) + { + _rowOffsets.Add(total); + Line ln = _lines[i]; + EnsureWrapped(ln, wrapCols); + total += ln.RowStarts.Length; + if (ln.Length > maxLen) maxLen = ln.Length; + } + _totalRows = total; + _maxLineLen = maxLen; + _layoutWrapCols = wrapCols; + _layoutDirty = false; + _layoutBuilt = true; + } + + private void RowToLine(int visualRow, out int line, out int rowInLine) + { + int count = _lines.Count; + int lo = 0, hi = count - 1, ans = 0; + while (lo <= hi) + { + int mid = (lo + hi) >> 1; + if (_rowOffsets[mid] <= visualRow) { ans = mid; lo = mid + 1; } + else hi = mid - 1; + } + line = ans; + rowInLine = visualRow - _rowOffsets[ans]; + } + + private static void RowRange(Line line, int rowInLine, out int start, out int end) + { + start = line.RowStarts[rowInLine]; + end = (rowInLine + 1 < line.RowStarts.Length) ? line.RowStarts[rowInLine + 1] : line.Length; + } + + private double ExtentWidthValue + { + get { return _wrapText ? _viewport.Width : (LeftPadding * 2 + _maxLineLen * _charWidth); } + } + + #endregion + + #region Public log API + + public void AppendLine(string text, Brush color = null, bool bold = false) + { + AddSegments(new[] { new Segment(text ?? string.Empty, color, bold) }); + } + + public void AppendSegments(IList segments) + { + if (segments == null || segments.Count == 0) { AddSegments(new[] { new Segment(string.Empty) }); return; } + Segment[] arr = new Segment[segments.Count]; + for (int i = 0; i < segments.Count; i++) arr[i] = segments[i]; + AddSegments(arr); + } + + public void SetText(string text) + { + Clear(); + AppendLine(text); + } + + public void Clear() + { + _lines.Clear(); + _rowOffsets.Clear(); + _totalRows = 0; + _maxLineLen = 0; + _layoutBuilt = false; + _layoutDirty = true; + _hasSelection = false; + _selecting = false; + _searchLine = -1; + _stickToBottom = true; + _offset = new Vector(0, 0); + InvalidateMeasure(); + InvalidateVisual(); + if (ScrollOwner != null) ScrollOwner.InvalidateScrollInfo(); + } + + public string GetText() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < _lines.Count; i++) + { + if (i > 0) sb.Append("\r\n"); + sb.Append(_lines[i].GetText()); + } + return sb.ToString(); + } + + public int LineCount { get { return _lines.Count; } } + + public string GetLineText(int index) + { + return (index >= 0 && index < _lines.Count) ? _lines[index].GetText() : string.Empty; + } + + private static string StripCr(string s) + { + return s.IndexOf('\r') >= 0 ? s.Replace("\r", string.Empty) : s; + } + + // Single normalization point for ALL appends (plain text, bold, and hyperlink lines, whether they + // arrive via the batched RichBox pipeline or directly). Splits embedded '\n' into separate visual + // lines (otherwise FormattedText would draw several lines stacked inside one row's height — the + // "overlapping text" bug), strips '\r', and expands tabs. + private void AddSegments(Segment[] segments) + { + bool hasNl = false; + for (int i = 0; i < segments.Length; i++) + if (segments[i].Text.IndexOf('\n') >= 0) { hasNl = true; break; } + + if (!hasNl) + { + AddLine(new Line(ExpandTabs(StripCrSegments(segments)))); + return; + } + + List cur = new List(); + for (int i = 0; i < segments.Length; i++) + { + Segment s = segments[i]; + string[] parts = s.Text.Split('\n'); + for (int p = 0; p < parts.Length; p++) + { + if (p > 0) + { + AddLine(new Line(ExpandTabs(cur.ToArray()))); + cur.Clear(); + } + string piece = StripCr(parts[p]); + if (piece.Length > 0) + cur.Add(new Segment(piece, s.Foreground, s.Bold, s.OnClick)); + } + } + AddLine(new Line(ExpandTabs(cur.ToArray()))); + } + + private static Segment[] StripCrSegments(Segment[] segments) + { + bool hasCr = false; + for (int i = 0; i < segments.Length; i++) + if (segments[i].Text.IndexOf('\r') >= 0) { hasCr = true; break; } + if (!hasCr) return segments; + + Segment[] result = new Segment[segments.Length]; + for (int i = 0; i < segments.Length; i++) + { + Segment s = segments[i]; + result[i] = s.Text.IndexOf('\r') >= 0 + ? new Segment(StripCr(s.Text), s.Foreground, s.Bold, s.OnClick) + : s; + } + return result; + } + + private static Segment[] ExpandTabs(Segment[] segments) + { + bool hasTab = false; + for (int i = 0; i < segments.Length; i++) + if (segments[i].Text.IndexOf('\t') >= 0) { hasTab = true; break; } + if (!hasTab) return segments; + + Segment[] result = new Segment[segments.Length]; + int col = 0; + for (int i = 0; i < segments.Length; i++) + { + Segment s = segments[i]; + if (s.Text.IndexOf('\t') < 0) { result[i] = s; col += s.Text.Length; continue; } + + StringBuilder sb = new StringBuilder(s.Text.Length + 8); + for (int c = 0; c < s.Text.Length; c++) + { + char ch = s.Text[c]; + if (ch == '\t') + { + int spaces = TabSize - (col % TabSize); + sb.Append(' ', spaces); + col += spaces; + } + else { sb.Append(ch); col++; } + } + result[i] = new Segment(sb.ToString(), s.Foreground, s.Bold, s.OnClick); + } + return result; + } + + private void AddLine(Line line) + { + _lines.Add(line); + + if (_lines.Count > MaxLines + TrimSlack) + { + int remove = _lines.Count - MaxLines; + _lines.RemoveRange(0, remove); + ShiftAfterTrim(remove); + _layoutDirty = true; // front removed: rebuild prefix table + } + + if (line.Length > _maxLineLen) _maxLineLen = line.Length; + + // Keep the visual-row layout live incrementally when it's valid, so autoscroll and the scrollbar + // stay correct without an O(n) rebuild per line. Otherwise mark it for a lazy rebuild. + if (_layoutBuilt && !_layoutDirty) + { + _rowOffsets.Add(_totalRows); + EnsureWrapped(line, _layoutWrapCols); + _totalRows += line.RowStarts.Length; + } + else + { + _layoutDirty = true; + } + + InvalidateMeasure(); + InvalidateVisual(); + if (ScrollOwner != null) ScrollOwner.InvalidateScrollInfo(); + + // Pin to the bottom immediately using the live row count. + if (_stickToBottom && !HasSelection && _viewport.Height > 0 && _lineHeight > 0) + { + EnsureLayout(); + double maxY = Math.Max(0, _totalRows * _lineHeight - _viewport.Height); + if (Math.Abs(maxY - _offset.Y) > 0.001) + { + _offset.Y = maxY; + if (ScrollOwner != null) ScrollOwner.InvalidateScrollInfo(); + InvalidateVisual(); + } + } + } + + private void ShiftAfterTrim(int removedLines) + { + if (_searchLine >= 0) + { + _searchLine -= removedLines; + if (_searchLine < 0) _searchLine = -1; + } + if (_hasSelection) + { + _selAnchor.Line -= removedLines; + _selCaret.Line -= removedLines; + if (_selAnchor.Line < 0 || _selCaret.Line < 0) + _hasSelection = false; + } + } + + #endregion + + #region Search support + + public void SetSearchHighlight(int line, int col, int length) + { + _searchLine = line; + _searchCol = col; + _searchLen = length; + InvalidateVisual(); + } + + public void ClearSearchHighlight() + { + _searchLine = -1; + InvalidateVisual(); + } + + /// Scroll so the given logical line sits roughly in the middle of the viewport. + public void ScrollLineIntoView(int line) + { + if (line < 0) return; + EnsureLayout(); + if (line >= _rowOffsets.Count) return; + double target = _rowOffsets[line] * _lineHeight - _viewport.Height / 2; + SetVerticalOffset(target); + } + + #endregion + + #region Rendering + + protected override void OnRender(DrawingContext dc) + { + EnsureLayout(); + + double w = RenderSize.Width, h = RenderSize.Height; + dc.DrawRectangle(Background ?? Brushes.Transparent, null, new Rect(0, 0, w, h)); + + if (_lines.Count == 0 || _lineHeight <= 0 || _totalRows == 0) + return; + + int firstRow = (int)Math.Floor(_offset.Y / _lineHeight); + int lastRow = (int)Math.Ceiling((_offset.Y + h) / _lineHeight); + if (firstRow < 0) firstRow = 0; + if (lastRow > _totalRows) lastRow = _totalRows; + + Pos selLo = default(Pos), selHi = default(Pos); + bool hasSel = _hasSelection && _selAnchor.CompareTo(_selCaret) != 0; + if (hasSel) + { + if (_selAnchor.CompareTo(_selCaret) <= 0) { selLo = _selAnchor; selHi = _selCaret; } + else { selLo = _selCaret; selHi = _selAnchor; } + } + + double baseX = LeftPadding - _offset.X; + + int line, rowInLine; + RowToLine(firstRow, out line, out rowInLine); + + for (int vr = firstRow; vr < lastRow; vr++) + { + // Advance to the line owning this visual row. + while (line < _lines.Count - 1 && vr >= _rowOffsets[line] + _lines[line].RowStarts.Length) + { + line++; + rowInLine = 0; + } + rowInLine = vr - _rowOffsets[line]; + + Line ln = _lines[line]; + int rs, re; + RowRange(ln, rowInLine, out rs, out re); + double y = vr * _lineHeight - _offset.Y; + + // Selection highlight (logical columns intersected with this row). + if (hasSel && line >= selLo.Line && line <= selHi.Line) + { + int from = (line == selLo.Line) ? selLo.Col : 0; + int to = (line == selHi.Line) ? selHi.Col : ln.Length; + int a = Math.Max(from, rs), b = Math.Min(to, re); + if (b > a) + dc.DrawRectangle(SelectionBrush, null, + new Rect(baseX + (a - rs) * _charWidth, y, (b - a) * _charWidth, _lineHeight)); + } + + // Search highlight. + if (_searchLine == line && _searchLen > 0) + { + int a = Math.Max(_searchCol, rs), b = Math.Min(_searchCol + _searchLen, re); + if (b > a) + dc.DrawRectangle(SearchBrush, null, + new Rect(baseX + (a - rs) * _charWidth, y, (b - a) * _charWidth, _lineHeight)); + } + + // Text: draw each segment piece that overlaps this row's [rs, re). + Segment[] segs = ln.Segments; + int segCol = 0; + for (int s = 0; s < segs.Length; s++) + { + Segment seg = segs[s]; + int segStart = segCol; + int segEnd = segCol + seg.Text.Length; + segCol = segEnd; + + int a = Math.Max(segStart, rs), b = Math.Min(segEnd, re); + if (b <= a) continue; + + string sub = seg.Text.Substring(a - segStart, b - a); + bool isLink = seg.OnClick != null; + Brush brush = isLink ? LinkBrush : (seg.Foreground ?? Foreground ?? Brushes.White); + Typeface tf = seg.Bold ? _boldTypeface : _typeface; + + double x = baseX + (a - rs) * _charWidth; + dc.DrawText(MakeText(sub, tf, brush), new Point(x, y)); + + if (isLink) + { + double uy = y + _lineHeight - 1.5; + dc.DrawLine(new Pen(brush, 1.0), new Point(x, uy), new Point(x + (b - a) * _charWidth, uy)); + } + } + } + } + + protected override Size MeasureOverride(Size availableSize) + { + EnsureMetrics(); + double vw = double.IsInfinity(availableSize.Width) ? 0 : availableSize.Width; + double vh = double.IsInfinity(availableSize.Height) ? 0 : availableSize.Height; + _viewport = new Size(vw, vh); + EnsureLayout(); + VerifyScrollData(_viewport, new Size(ExtentWidthValue, _totalRows * _lineHeight)); + return new Size(vw, vh); + } + + protected override Size ArrangeOverride(Size finalSize) + { + EnsureMetrics(); + _viewport = finalSize; + EnsureLayout(); + VerifyScrollData(finalSize, new Size(ExtentWidthValue, _totalRows * _lineHeight)); + return finalSize; + } + + #endregion + + #region Mouse / keyboard interaction + + private bool PointToLineCol(Point p, out int line, out int col) + { + line = 0; col = 0; + EnsureLayout(); + if (_lines.Count == 0 || _lineHeight <= 0 || _totalRows == 0) + return false; + + int vr = (int)Math.Floor((p.Y + _offset.Y) / _lineHeight); + if (vr < 0) vr = 0; + if (vr >= _totalRows) vr = _totalRows - 1; + + int rowInLine; + RowToLine(vr, out line, out rowInLine); + int rs, re; + RowRange(_lines[line], rowInLine, out rs, out re); + + int colInRow = (int)Math.Round((p.X - LeftPadding + _offset.X) / _charWidth); + if (colInRow < 0) colInRow = 0; + col = rs + colInRow; + if (col > re) col = re; + if (col > _lines[line].Length) col = _lines[line].Length; + return true; + } + + private Pos PointToPos(Point p) + { + int line, col; + PointToLineCol(p, out line, out col); + return new Pos(line, col); + } + + private Action HitTestLink(Point p) + { + EnsureLayout(); + if (_lines.Count == 0 || _lineHeight <= 0 || _totalRows == 0) + return null; + + int vr = (int)Math.Floor((p.Y + _offset.Y) / _lineHeight); + if (vr < 0 || vr >= _totalRows) return null; + + int line, rowInLine; + RowToLine(vr, out line, out rowInLine); + int rs, re; + RowRange(_lines[line], rowInLine, out rs, out re); + + int colInRow = (int)Math.Floor((p.X - LeftPadding + _offset.X) / _charWidth); + if (colInRow < 0) return null; + int col = rs + colInRow; + if (col >= re || col >= _lines[line].Length) return null; + + int segCol = 0; + Segment[] segs = _lines[line].Segments; + for (int s = 0; s < segs.Length; s++) + { + int len = segs[s].Text.Length; + if (col >= segCol && col < segCol + len) + return segs[s].OnClick; + segCol += len; + } + return null; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + Point p = e.GetPosition(this); + + if (_selecting && e.LeftButton == MouseButtonState.Pressed) + { + _selCaret = PointToPos(p); + _hasSelection = true; + if (p.Y < 0) SetVerticalOffset(_offset.Y - _lineHeight); + else if (p.Y > RenderSize.Height) SetVerticalOffset(_offset.Y + _lineHeight); + InvalidateVisual(); + return; + } + + Cursor = HitTestLink(p) != null ? Cursors.Hand : Cursors.IBeam; + } + + protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) + { + base.OnMouseLeftButtonDown(e); + Keyboard.Focus(this); + _mouseDownPoint = e.GetPosition(this); + _selAnchor = _selCaret = PointToPos(_mouseDownPoint); + _hasSelection = false; + _selecting = true; + CaptureMouse(); + InvalidateVisual(); + } + + protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) + { + base.OnMouseLeftButtonUp(e); + _selecting = false; + ReleaseMouseCapture(); + + Point p = e.GetPosition(this); + double moved = Math.Abs(p.X - _mouseDownPoint.X) + Math.Abs(p.Y - _mouseDownPoint.Y); + if (moved < 3) + { + Action onClick = HitTestLink(p); + if (onClick != null) + { + try { onClick(); } + catch (Exception ex) { Debug.WriteLine("LogView link click error: " + ex); } + } + } + } + + protected override void OnMouseWheel(MouseWheelEventArgs e) + { + base.OnMouseWheel(e); + double lines = e.Delta / 120.0 * 3.0; + SetVerticalOffset(_offset.Y - lines * _lineHeight); + e.Handled = true; + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + bool ctrl = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; + if (ctrl && e.Key == Key.C) { CopySelection(); e.Handled = true; } + else if (ctrl && e.Key == Key.A) { SelectAll(); e.Handled = true; } + else if (e.Key == Key.PageDown) { PageDown(); e.Handled = true; } + else if (e.Key == Key.PageUp) { PageUp(); e.Handled = true; } + else if (e.Key == Key.Home && ctrl) { ScrollToHome(); e.Handled = true; } + else if (e.Key == Key.End && ctrl) { ScrollToEnd(); e.Handled = true; } + } + + public void SelectAll() + { + if (_lines.Count == 0) return; + _selAnchor = new Pos(0, 0); + _selCaret = new Pos(_lines.Count - 1, _lines[_lines.Count - 1].Length); + _hasSelection = true; + InvalidateVisual(); + } + + public bool HasSelection { get { return _hasSelection && _selAnchor.CompareTo(_selCaret) != 0; } } + + public void CopySelection() + { + string text = GetSelectedText(); + if (string.IsNullOrEmpty(text)) return; + try { Clipboard.SetText(text); } + catch (Exception ex) { Debug.WriteLine("LogView copy error: " + ex); } + } + + /// Copy the entire log to the clipboard (regardless of selection). + public void CopyAll() + { + string text = GetText(); + if (string.IsNullOrEmpty(text)) return; + try { Clipboard.SetText(text); } + catch (Exception ex) { Debug.WriteLine("LogView copy-all error: " + ex); } + } + + private string GetSelectedText() + { + if (!HasSelection) return string.Empty; + Pos lo, hi; + if (_selAnchor.CompareTo(_selCaret) <= 0) { lo = _selAnchor; hi = _selCaret; } + else { lo = _selCaret; hi = _selAnchor; } + + StringBuilder sb = new StringBuilder(); + for (int i = lo.Line; i <= hi.Line && i < _lines.Count; i++) + { + string t = _lines[i].GetText(); + int from = (i == lo.Line) ? Math.Min(lo.Col, t.Length) : 0; + int to = (i == hi.Line) ? Math.Min(hi.Col, t.Length) : t.Length; + if (to > from) sb.Append(t.Substring(from, to - from)); + if (i != hi.Line) sb.Append("\r\n"); + } + return sb.ToString(); + } + + #endregion + + #region IScrollInfo + + private Vector _offset; + private Size _viewport; + private Size _extent; + private bool _canHScroll; + private bool _canVScroll = true; + + public bool CanVerticallyScroll { get { return _canVScroll; } set { _canVScroll = value; } } + public bool CanHorizontallyScroll { get { return _canHScroll; } set { _canHScroll = value; } } + + public double ExtentWidth { get { return _extent.Width; } } + public double ExtentHeight { get { return _extent.Height; } } + public double ViewportWidth { get { return _viewport.Width; } } + public double ViewportHeight { get { return _viewport.Height; } } + public double HorizontalOffset { get { return _offset.X; } } + public double VerticalOffset { get { return _offset.Y; } } + public ScrollViewer ScrollOwner { get; set; } + + private void VerifyScrollData(Size viewport, Size extent) + { + bool changed = viewport != _viewport || extent != _extent; + _viewport = viewport; + _extent = extent; + + double maxY = Math.Max(0, _extent.Height - _viewport.Height); + double maxX = Math.Max(0, _extent.Width - _viewport.Width); + // Stay pinned to the bottom as new rows extend the document — unless the user scrolled up or is + // holding a selection (don't yank content out from under a drag-select). + bool pin = _stickToBottom && !HasSelection; + double cy = pin ? maxY : Math.Min(Math.Max(0, _offset.Y), maxY); + double cx = Math.Min(Math.Max(0, _offset.X), maxX); + if (cy != _offset.Y || cx != _offset.X) { _offset.X = cx; _offset.Y = cy; changed = true; } + + if (changed && ScrollOwner != null) + ScrollOwner.InvalidateScrollInfo(); + } + + public void SetVerticalOffset(double offset) + { + double maxY = Math.Max(0, _extent.Height - _viewport.Height); + if (offset > maxY) offset = maxY; + if (offset < 0) offset = 0; + _stickToBottom = offset >= maxY - 0.5; + if (Math.Abs(offset - _offset.Y) < 0.001) return; + _offset.Y = offset; + if (ScrollOwner != null) ScrollOwner.InvalidateScrollInfo(); + InvalidateVisual(); + } + + public void SetHorizontalOffset(double offset) + { + double maxX = Math.Max(0, _extent.Width - _viewport.Width); + if (offset > maxX) offset = maxX; + if (offset < 0) offset = 0; + if (Math.Abs(offset - _offset.X) < 0.001) return; + _offset.X = offset; + if (ScrollOwner != null) ScrollOwner.InvalidateScrollInfo(); + InvalidateVisual(); + } + + public void LineUp() { SetVerticalOffset(_offset.Y - _lineHeight); } + public void LineDown() { SetVerticalOffset(_offset.Y + _lineHeight); } + public void LineLeft() { SetHorizontalOffset(_offset.X - _charWidth); } + public void LineRight() { SetHorizontalOffset(_offset.X + _charWidth); } + public void PageUp() { SetVerticalOffset(_offset.Y - _viewport.Height); } + public void PageDown() { SetVerticalOffset(_offset.Y + _viewport.Height); } + public void PageLeft() { SetHorizontalOffset(_offset.X - _viewport.Width); } + public void PageRight() { SetHorizontalOffset(_offset.X + _viewport.Width); } + public void MouseWheelUp() { SetVerticalOffset(_offset.Y - 3 * _lineHeight); } + public void MouseWheelDown() { SetVerticalOffset(_offset.Y + 3 * _lineHeight); } + public void MouseWheelLeft() { SetHorizontalOffset(_offset.X - 3 * _charWidth); } + public void MouseWheelRight() { SetHorizontalOffset(_offset.X + 3 * _charWidth); } + + public Rect MakeVisible(Visual visual, Rect rectangle) { return rectangle; } + + #endregion + + #region Scroll helpers (RichTextBox-compatible names) + + public void ScrollToEnd() { SetVerticalOffset(double.MaxValue); } + public void ScrollToHome() { SetVerticalOffset(0); } + public void ScrollToVerticalOffset(double offset) { SetVerticalOffset(offset); } + + #endregion + } +} diff --git a/APKToolGUI/Controls/NativeDarkMode.cs b/APKToolGUI/Controls/NativeDarkMode.cs new file mode 100644 index 0000000..3ede266 --- /dev/null +++ b/APKToolGUI/Controls/NativeDarkMode.cs @@ -0,0 +1,278 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using Microsoft.Win32; + +namespace APKToolGUI.Controls +{ + /// + /// Application theme selection. + /// + /// The integer values intentionally match the stored Settings.Default.Theme + /// values and the order of the theme combo box (0 = Auto, 1 = Light, 2 = Dark), + /// so existing config files keep working. This is a drop-in replacement for the + /// former Dark.Net.Theme enum. + /// + /// + public enum Theme + { + Auto = 0, + Light = 1, + Dark = 2 + } + + /// + /// Self-contained dark mode support for Windows 10 (1809 / build 17763 and newer) + /// and Windows 11, written from scratch to replace the external DarkNet package. + /// + /// + /// Immersive dark title bars via DwmSetWindowAttribute. + /// Dark Win32 popup/menu rendering via the undocumented uxtheme app-mode ordinals. + /// Dark scroll bars and combo box drop-downs via SetWindowTheme. + /// + /// + /// All methods are safe no-ops on operating systems that do not support these APIs, + /// so callers do not need to guard them with an OS-version check. + /// + public static class NativeDarkMode + { + #region Native interop + + [DllImport("dwmapi.dll")] + private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attribute, ref int pvAttribute, int cbAttribute); + + [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)] + private static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); + + // uxtheme.dll ordinal #135: + // Windows 10 1809 -> AllowDarkModeForApp(bool) + // Windows 10 1903+ -> SetPreferredAppMode(PreferredAppMode) + [DllImport("uxtheme.dll", EntryPoint = "#135")] + private static extern int SetPreferredAppMode(int preferredAppMode); + + [DllImport("uxtheme.dll", EntryPoint = "#135")] + private static extern bool AllowDarkModeForApp(bool allow); + + // uxtheme.dll ordinal #136: FlushMenuThemes() + [DllImport("uxtheme.dll", EntryPoint = "#136")] + private static extern void FlushMenuThemes(); + + // RtlGetVersion always returns the true OS version, unlike Environment.OSVersion + // / GetVersionEx which "lie" (report Windows 8 / 6.2) when the app has no manifest + // declaring Windows 10 compatibility - which is exactly this project's case. + [DllImport("ntdll.dll")] + private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOEX versionInfo); + + [StructLayout(LayoutKind.Sequential)] + private struct RTL_OSVERSIONINFOEX + { + internal uint dwOSVersionInfoSize; + internal uint dwMajorVersion; + internal uint dwMinorVersion; + internal uint dwBuildNumber; + internal uint dwPlatformId; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + internal string szCSDVersion; + } + + // DwmSetWindowAttribute "use immersive dark mode" attribute id. + // It moved from 19 to 20 in Windows 10 build 19041 (20H1); we try the new + // one first and fall back to the old one for 1809 / 1903 / 1909. + private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19; + private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20; + + private enum PreferredAppMode + { + Default = 0, + AllowDark = 1, + ForceDark = 2, + ForceLight = 3 + } + + private const int BUILD_1809 = 17763; // earliest build exposing the dark mode ordinals + private const int BUILD_1903 = 18362; // ordinal #135 becomes SetPreferredAppMode(int) + private const int BUILD_20H1 = 19041; // DWM immersive dark mode attribute becomes 20 + + #endregion + + /// + /// The true OS version, queried once via RtlGetVersion so it is correct + /// even though this app has no Windows 10 compatibility manifest embedded. + /// + private static readonly Version _osVersion = GetRealOSVersion(); + + private static Version GetRealOSVersion() + { + try + { + var info = new RTL_OSVERSIONINFOEX + { + dwOSVersionInfoSize = (uint)Marshal.SizeOf(typeof(RTL_OSVERSIONINFOEX)) + }; + if (RtlGetVersion(ref info) == 0) // STATUS_SUCCESS + return new Version((int)info.dwMajorVersion, (int)info.dwMinorVersion, (int)info.dwBuildNumber); + } + catch + { + // ntdll unavailable - fall back to the (possibly lying) framework value. + } + return Environment.OSVersion.Version; + } + + private static int WindowsBuild => _osVersion.Build; + + /// + /// True when the running OS is Windows 10 1809 or newer, where the dark mode + /// APIs used here exist. + /// + public static bool IsSupported => + _osVersion.Major >= 10 && + WindowsBuild >= BUILD_1809; + + /// + /// Sets the process-wide app mode so that Win32 popup menus, context menus and + /// common controls render dark. Call this once, before any window is created. + /// Mirrors DarkNet.SetCurrentProcessTheme. + /// + public static void SetProcessTheme(Theme theme) + { + if (!IsSupported) + return; + + try + { + bool dark = EffectiveIsDark(theme); + if (WindowsBuild >= BUILD_1903) + SetPreferredAppMode((int)(dark ? PreferredAppMode.ForceDark : PreferredAppMode.ForceLight)); + else + AllowDarkModeForApp(dark); + FlushMenuThemes(); + } + catch + { + // These ordinals are undocumented; ignore failures on unexpected builds. + } + } + + /// + /// Applies (or removes) the immersive dark title bar on a form. Safe to call + /// before the window handle exists - it is applied as soon as the handle is + /// created and re-applied once the window is shown. Mirrors + /// DarkNet.SetWindowThemeForms. + /// + public static void ApplyTheme(Form form, Theme theme) + { + if (form == null || !IsSupported) + return; + + bool dark = EffectiveIsDark(theme); + + if (form.IsHandleCreated) + UseImmersiveDarkTitleBar(form.Handle, dark); + else + form.HandleCreated += (s, e) => UseImmersiveDarkTitleBar(form.Handle, dark); + + // Some builds only honour the attribute once the window is actually visible. + form.Shown += (s, e) => UseImmersiveDarkTitleBar(form.Handle, dark); + } + + /// + /// Applies (or removes) the immersive dark title bar on a WPF window. Safe to + /// call before the native handle exists - it is applied on + /// SourceInitialized, which fires before the window is shown. + /// + public static void ApplyTheme(System.Windows.Window window, Theme theme) + { + if (window == null || !IsSupported) + return; + + bool dark = EffectiveIsDark(theme); + var helper = new System.Windows.Interop.WindowInteropHelper(window); + + if (helper.Handle != IntPtr.Zero) + UseImmersiveDarkTitleBar(helper.Handle, dark); + else + window.SourceInitialized += (s, e) => + UseImmersiveDarkTitleBar(new System.Windows.Interop.WindowInteropHelper(window).Handle, dark); + } + + /// + /// Toggles the immersive dark mode title bar for an arbitrary window handle. + /// + public static void UseImmersiveDarkTitleBar(IntPtr handle, bool enabled) + { + if (handle == IntPtr.Zero || !IsSupported) + return; + + int useImmersiveDarkMode = enabled ? 1 : 0; + int attribute = WindowsBuild >= BUILD_20H1 + ? DWMWA_USE_IMMERSIVE_DARK_MODE + : DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1; + + if (DwmSetWindowAttribute(handle, attribute, ref useImmersiveDarkMode, sizeof(int)) != 0) + { + // Fall back to the other attribute id if the first one was not accepted. + int fallback = attribute == DWMWA_USE_IMMERSIVE_DARK_MODE + ? DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 + : DWMWA_USE_IMMERSIVE_DARK_MODE; + DwmSetWindowAttribute(handle, fallback, ref useImmersiveDarkMode, sizeof(int)); + } + } + + /// + /// Gives a control dark-themed scroll bars / drop-downs. Use + /// "DarkMode_Explorer" for scroll bars and lists, "DarkMode_CFD" + /// for combo boxes. Safe to call before the handle exists. + /// + public static void UseDarkControlTheme(Control control, string subAppName = "DarkMode_Explorer") + { + if (control == null || !IsSupported) + return; + + if (control.IsHandleCreated) + SetWindowTheme(control.Handle, subAppName, null); + else + control.HandleCreated += (s, e) => SetWindowTheme(control.Handle, subAppName, null); + } + + /// + /// Resolves a to an effective dark/light decision, + /// reading the Windows personalization setting for . + /// Mirrors DarkNet.EffectiveCurrentProcessThemeIsDark. + /// + public static bool EffectiveIsDark(Theme theme) + { + switch (theme) + { + case Theme.Dark: + return true; + case Theme.Light: + return false; + default: + return IsSystemUsingDarkMode(); + } + } + + /// + /// Reads whether the current user has selected the dark app theme in Windows. + /// + public static bool IsSystemUsingDarkMode() + { + try + { + using (RegistryKey key = Registry.CurrentUser.OpenSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")) + { + // AppsUseLightTheme: 0 = dark, 1 = light (absent means light). + if (key?.GetValue("AppsUseLightTheme") is int appsUseLightTheme) + return appsUseLightTheme == 0; + } + } + catch + { + // Registry unavailable - assume light. + } + return false; + } + } +} diff --git a/APKToolGUI/Controls/NumericUpDown.cs b/APKToolGUI/Controls/NumericUpDown.cs new file mode 100644 index 0000000..32b8101 --- /dev/null +++ b/APKToolGUI/Controls/NumericUpDown.cs @@ -0,0 +1,92 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; + +namespace APKToolGUI.Controls +{ + /// + /// Small themed numeric up/down control (WPF has no built-in equivalent of the + /// WinForms NumericUpDown). Templated in Themes/Controls.xaml. + /// + [TemplatePart(Name = "PART_TextBox", Type = typeof(TextBox))] + [TemplatePart(Name = "PART_Up", Type = typeof(RepeatButton))] + [TemplatePart(Name = "PART_Down", Type = typeof(RepeatButton))] + public class NumericUpDown : Control + { + private TextBox _textBox; + private bool _updating; + + static NumericUpDown() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), + new FrameworkPropertyMetadata(typeof(NumericUpDown))); + } + + public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register( + "Minimum", typeof(int), typeof(NumericUpDown), new PropertyMetadata(0, OnRangeChanged)); + + public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( + "Maximum", typeof(int), typeof(NumericUpDown), new PropertyMetadata(100, OnRangeChanged)); + + public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( + "Value", typeof(int), typeof(NumericUpDown), + new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnValueChanged)); + + public int Minimum { get { return (int)GetValue(MinimumProperty); } set { SetValue(MinimumProperty, value); } } + public int Maximum { get { return (int)GetValue(MaximumProperty); } set { SetValue(MaximumProperty, value); } } + public int Value { get { return (int)GetValue(ValueProperty); } set { SetValue(ValueProperty, value); } } + + private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var n = (NumericUpDown)d; + int clamped = n.Clamp((int)e.NewValue); + if (clamped != (int)e.NewValue) { n.Value = clamped; return; } + n.UpdateText(); + } + + private static void OnRangeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var n = (NumericUpDown)d; + n.Value = n.Clamp(n.Value); + } + + private int Clamp(int v) + { + if (v < Minimum) return Minimum; + if (v > Maximum) return Maximum; + return v; + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if (_textBox != null) _textBox.TextChanged -= TextBox_TextChanged; + _textBox = GetTemplateChild("PART_TextBox") as TextBox; + if (_textBox != null) _textBox.TextChanged += TextBox_TextChanged; + + var up = GetTemplateChild("PART_Up") as RepeatButton; + var down = GetTemplateChild("PART_Down") as RepeatButton; + if (up != null) up.Click += (s, e) => Value = Clamp(Value + 1); + if (down != null) down.Click += (s, e) => Value = Clamp(Value - 1); + + UpdateText(); + } + + private void TextBox_TextChanged(object sender, TextChangedEventArgs e) + { + if (_updating) return; + int v; + if (int.TryParse(_textBox.Text, out v)) + Value = Clamp(v); + } + + private void UpdateText() + { + if (_textBox == null) return; + _updating = true; + _textBox.Text = Value.ToString(); + _updating = false; + } + } +} diff --git a/APKToolGUI/Controls/WpfTheme.cs b/APKToolGUI/Controls/WpfTheme.cs new file mode 100644 index 0000000..cdbc2bb --- /dev/null +++ b/APKToolGUI/Controls/WpfTheme.cs @@ -0,0 +1,73 @@ +using System.Windows; +using System.Windows.Media; + +namespace APKToolGUI.Controls +{ + /// + /// Shared dark/light palette for the WPF windows. Fills the DynamicResource + /// brush keys consumed by Themes/Controls.xaml and the window XAML, so every + /// converted window themes consistently. The dark palette mirrors the WinForms + /// colors used by the not-yet-converted forms. + /// + public static class WpfTheme + { + /// + /// Applies the dark or light palette to a window/element's resource dictionary. + /// The merged Themes/Controls.xaml styles pick these up via DynamicResource. + /// + public static void Apply(FrameworkElement target, bool dark) + { + if (dark) + { + Set(target, "WindowBackground", 32, 32, 32); + Set(target, "PrimaryText", 255, 255, 255); + Set(target, "SecondaryText", 160, 160, 160); + Set(target, "PanelBackground", 64, 64, 64); // text input background + Set(target, "ControlBackground", 51, 51, 51); // combo / checkbox box + Set(target, "PanelBorder", 90, 90, 90); + Set(target, "Accent", 0, 120, 215); + Set(target, "LinkText", 30, 144, 255); // DodgerBlue + Set(target, "ButtonBackground", 51, 51, 51); + Set(target, "ButtonBorder", 155, 155, 155); + Set(target, "ButtonHover", 61, 61, 61); + Set(target, "ButtonPressed", 42, 42, 42); + Set(target, "ScrollTrack", 45, 45, 45); + Set(target, "ScrollThumb", 85, 85, 85); + Set(target, "TabBackground", 45, 45, 45); // unselected tab + Set(target, "MenuBar", 32, 32, 32); + Set(target, "MenuPopup", 43, 43, 43); + Set(target, "MenuHighlight", 61, 61, 61); + Set(target, "LogBackground", 30, 30, 30); + } + else + { + Set(target, "WindowBackground", 240, 240, 240); + Set(target, "PrimaryText", 0, 0, 0); + Set(target, "SecondaryText", 105, 105, 105); // DimGray + Set(target, "PanelBackground", 255, 255, 255); + Set(target, "ControlBackground", 255, 255, 255); + Set(target, "PanelBorder", 171, 173, 179); + Set(target, "Accent", 0, 120, 215); + Set(target, "LinkText", 30, 144, 255); + Set(target, "ButtonBackground", 225, 225, 225); + Set(target, "ButtonBorder", 173, 173, 173); + Set(target, "ButtonHover", 229, 241, 251); + Set(target, "ButtonPressed", 204, 228, 247); + Set(target, "ScrollTrack", 240, 240, 240); + Set(target, "ScrollThumb", 180, 180, 180); + Set(target, "TabBackground", 224, 224, 224); + Set(target, "MenuBar", 240, 240, 240); + Set(target, "MenuPopup", 250, 250, 250); + Set(target, "MenuHighlight", 204, 228, 247); + Set(target, "LogBackground", 255, 255, 255); + } + } + + private static void Set(FrameworkElement target, string key, byte r, byte g, byte b) + { + var brush = new SolidColorBrush(Color.FromRgb(r, g, b)); + brush.Freeze(); + target.Resources[key] = brush; + } + } +} diff --git a/APKToolGUI/ExplorerContextMenu.cs b/APKToolGUI/ExplorerContextMenu.cs deleted file mode 100644 index 1d9dfb7..0000000 --- a/APKToolGUI/ExplorerContextMenu.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using Microsoft.Win32; - -namespace APKToolGUI -{ - public class ExplorerContextMenu - { - public static Status Create() - { - string executablePath = System.Reflection.Assembly.GetExecutingAssembly().Location; - if (IsAdmin()) - { - if (Environment.OSVersion.Version >= new Version("6.0.0.0")) // Vista и новее - { - return CreateVistaAndLater(executablePath); - } - else if (Environment.OSVersion.Version < new Version("6.0.0.0") && Environment.OSVersion.Version >= new Version("5.1.0.0")) - { - return CreateXP(executablePath); - } - else - return new Status(false, "Unsupported OS"); - } - else - return new Status(false, "Administrator rights are required"); - } - - public static Status Remove() - { - if (Environment.OSVersion.Version >= new Version("6.0.0.0")) // Vista и новее - { - return RemoveVistaAndLater(); - } - else - { - if (Environment.OSVersion.Version < new Version("6.0.0.0") && Environment.OSVersion.Version >= new Version("5.1.0.0")) - { - return RemoveXP(); - } - else - return new Status(false, "Unsupported OS"); - } - } - - public static bool IsAdmin() - { - System.Security.Principal.WindowsIdentity id = System.Security.Principal.WindowsIdentity.GetCurrent(); - System.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(id); - - return p.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator); - } - - private static Status CreateVistaAndLater(string executablePath) - { - try - { - #region Add context menu to registry - - RegistryKey apkToolGUIFolderShell = Registry.ClassesRoot.OpenSubKey(@"Directory\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).CreateSubKey("APKToolGUI", RegistryKeyPermissionCheck.ReadWriteSubTree); - apkToolGUIFolderShell.SetValue("Icon", executablePath); - apkToolGUIFolderShell.SetValue("MUIVerb", "APKToolGUI"); - apkToolGUIFolderShell.SetValue("SubCommands", "APKToolGUI.Build"); - apkToolGUIFolderShell.Close(); - - Registry.ClassesRoot.OpenSubKey("SystemFileAssociations", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).CreateSubKey(".apk", RegistryKeyPermissionCheck.ReadWriteSubTree).CreateSubKey("DefaultIcon", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", executablePath, RegistryValueKind.ExpandString); - RegistryKey shellAPK = Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.CreateSubKey).CreateSubKey("shell", RegistryKeyPermissionCheck.ReadWriteSubTree).CreateSubKey("APKToolGUI", RegistryKeyPermissionCheck.ReadWriteSubTree); - shellAPK.SetValue("Icon", "\"" + executablePath + "\""); - shellAPK.SetValue("MUIVerb", "APKToolGUI"); - shellAPK.SetValue("SubCommands", "APKToolGUI.Decompile;APKToolGUI.InstallFramework;APKToolGUI.Sign"); - shellAPK.Close(); - - #endregion - - #region Add command to registry - - RegistryKey shell; - if (Environment.Is64BitOperatingSystem) - shell = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64).OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl); - else - shell = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl); - - RegistryKey decompile = shell.CreateSubKey("APKToolGUI.Decompile", RegistryKeyPermissionCheck.ReadWriteSubTree); - decompile.SetValue("", Language.Decode, RegistryValueKind.String); - decompile.SetValue("Icon", executablePath, RegistryValueKind.String); - decompile.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"d\" \"%1\""); - decompile.Close(); - - RegistryKey installFramework = shell.CreateSubKey("APKToolGUI.InstallFramework", RegistryKeyPermissionCheck.ReadWriteSubTree); - installFramework.SetValue("", Language.InstallFramework, RegistryValueKind.String); - installFramework.SetValue("Icon", executablePath, RegistryValueKind.String); - installFramework.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"if\" \"%1\""); - installFramework.Close(); - - RegistryKey sign = shell.CreateSubKey("APKToolGUI.Sign", RegistryKeyPermissionCheck.ReadWriteSubTree); - sign.SetValue("", Language.Sign, RegistryValueKind.String); - sign.SetValue("Icon", executablePath, RegistryValueKind.String); - sign.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"sign\" \"%1\""); - sign.Close(); - - RegistryKey build = shell.CreateSubKey("APKToolGUI.Build", RegistryKeyPermissionCheck.ReadWriteSubTree); - build.SetValue("", Language.Build, RegistryValueKind.String); - build.SetValue("Icon", executablePath, RegistryValueKind.String); - build.CreateSubKey("command").SetValue("", "\"" + executablePath + "\" \"b\" \"%1\"", RegistryValueKind.String); - build.Close(); - - shell.Close(); - - #endregion - } - catch (Exception exc) - { - return new Status(false, exc.Message); - } - - return new Status(true, "Done!"); - } - - private static Status CreateXP(string executablePath) - { - try - { - RegistryKey folderShell = Registry.ClassesRoot.OpenSubKey(@"Directory\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).CreateSubKey("APKToolGUI.Build", RegistryKeyPermissionCheck.ReadWriteSubTree); - folderShell.SetValue("Icon", executablePath); - folderShell.SetValue("MUIVerb", Language.Build); - folderShell.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"b\" \"%1\"", RegistryValueKind.String); - folderShell.Close(); - - RegistryKey apk = Registry.ClassesRoot.OpenSubKey("SystemFileAssociations", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).CreateSubKey(".apk", RegistryKeyPermissionCheck.ReadWriteSubTree); - apk.CreateSubKey("DefaultIcon", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", executablePath, RegistryValueKind.ExpandString); - RegistryKey shell = apk.CreateSubKey("shell", RegistryKeyPermissionCheck.ReadWriteSubTree); - - RegistryKey decode = shell.CreateSubKey("APKToolGUI.Decode", RegistryKeyPermissionCheck.ReadWriteSubTree); - RegistryKey installFramework = shell.CreateSubKey("APKToolGUI.InstallFramework", RegistryKeyPermissionCheck.ReadWriteSubTree); - RegistryKey sign = shell.CreateSubKey("APKToolGUI.Sign", RegistryKeyPermissionCheck.ReadWriteSubTree); - - decode.SetValue("Icon", executablePath); - decode.SetValue("MUIVerb", Language.Decode); - decode.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"d\" \"%1\""); - decode.Close(); - - installFramework.SetValue("Icon", executablePath); - installFramework.SetValue("MUIVerb", Language.InstallFramework); - installFramework.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"if\" \"%1\""); - installFramework.Close(); - - sign.SetValue("Icon", executablePath); - sign.SetValue("MUIVerb", Language.Sign); - sign.CreateSubKey("command", RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("", "\"" + executablePath + "\" \"sign\" \"%1\""); - sign.Close(); - - shell.Close(); - apk.Close(); - } - catch (Exception exc) - { - return new Status(false, exc.Message); - } - - return new Status(true, "Done!"); - } - - private static Status RemoveVistaAndLater() - { - try - { - Registry.ClassesRoot.OpenSubKey(@"Directory\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("APKToolGUI", false); - - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("DefaultIcon", false); - - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKey("APKToolGUI", false); - - RegistryKey shell; - if (Environment.Is64BitOperatingSystem) - shell = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64).OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl); - else - shell = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl); - shell.DeleteSubKeyTree("APKToolGUI.Decompile", false); - shell.DeleteSubKeyTree("APKToolGUI.InstallFramework", false); - shell.DeleteSubKeyTree("APKToolGUI.Sign", false); - shell.DeleteSubKeyTree("APKToolGUI.Build", false); - shell.Close(); - } - catch (Exception exc) - { - return new Status(false, exc.Message); - } - - return new Status(true, "Done!"); - } - - private static Status RemoveXP() - { - try - { - Registry.ClassesRoot.OpenSubKey(@"Directory\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("APKToolGUI.Build", false); - - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("DefaultIcon", false); - - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("APKToolGUI.Decode", false); - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("APKToolGUI.InstallFramework", false); - Registry.ClassesRoot.OpenSubKey(@"SystemFileAssociations\.apk\shell", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl).DeleteSubKeyTree("APKToolGUI.Sign", false); - } - catch (Exception exc) - { - return new Status(false, exc.Message); - } - - return new Status(true, "Done!"); - } - - public class Status - { - public Status(bool result, string message) - { - Result = result; - Message = message; - } - public bool Result { get; set; } - public String Message { get; set; } - } - - public enum Action - { - Create, - Remove - } - } -} \ No newline at end of file diff --git a/APKToolGUI/FodyWeavers.xml b/APKToolGUI/FodyWeavers.xml new file mode 100644 index 0000000..dcd2f9f --- /dev/null +++ b/APKToolGUI/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/APKToolGUI/FodyWeavers.xsd b/APKToolGUI/FodyWeavers.xsd new file mode 100644 index 0000000..f2dbece --- /dev/null +++ b/APKToolGUI/FodyWeavers.xsd @@ -0,0 +1,176 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + Obsolete, use UnmanagedWinX86Assemblies instead + + + + + A list of unmanaged X86 (32 bit) assembly names to include, delimited with line breaks. + + + + + Obsolete, use UnmanagedWinX64Assemblies instead. + + + + + A list of unmanaged X64 (64 bit) assembly names to include, delimited with line breaks. + + + + + A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + The attach method no longer subscribes to the `AppDomain.AssemblyResolve` (.NET 4.x) and `AssemblyLoadContext.Resolving` (.NET 6.0+) events. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + Obsolete, use UnmanagedWinX86Assemblies instead + + + + + A list of unmanaged X86 (32 bit) assembly names to include, delimited with |. + + + + + Obsolete, use UnmanagedWinX64Assemblies instead + + + + + A list of unmanaged X64 (64 bit) assembly names to include, delimited with |. + + + + + A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/APKToolGUI/FormAboutBox.Designer.cs b/APKToolGUI/FormAboutBox.Designer.cs deleted file mode 100644 index 956f238..0000000 --- a/APKToolGUI/FormAboutBox.Designer.cs +++ /dev/null @@ -1,128 +0,0 @@ -namespace APKToolGUI -{ - partial class FormAboutBox - { - /// - /// Требуется переменная конструктора. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Освободить все используемые ресурсы. - /// - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Код, автоматически созданный конструктором форм Windows - - /// - /// Обязательный метод для поддержки конструктора - не изменяйте - /// содержимое данного метода при помощи редактора кода. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAboutBox)); - this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - this.logoPictureBox = new System.Windows.Forms.PictureBox(); - this.labelProductName = new System.Windows.Forms.Label(); - this.labelVersion = new System.Windows.Forms.Label(); - this.labelCopyright = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.textBoxDescription = new System.Windows.Forms.TextBox(); - this.linkLabel1 = new System.Windows.Forms.LinkLabel(); - this.tableLayoutPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); - this.SuspendLayout(); - // - // tableLayoutPanel - // - resources.ApplyResources(this.tableLayoutPanel, "tableLayoutPanel"); - this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); - this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); - this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); - this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); - this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); - this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); - this.tableLayoutPanel.Controls.Add(this.linkLabel1, 1, 3); - this.tableLayoutPanel.Name = "tableLayoutPanel"; - // - // logoPictureBox - // - resources.ApplyResources(this.logoPictureBox, "logoPictureBox"); - this.logoPictureBox.Image = global::APKToolGUI.Properties.Resources.android; - this.logoPictureBox.Name = "logoPictureBox"; - this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); - this.logoPictureBox.TabStop = false; - // - // labelProductName - // - resources.ApplyResources(this.labelProductName, "labelProductName"); - this.labelProductName.Name = "labelProductName"; - // - // labelVersion - // - resources.ApplyResources(this.labelVersion, "labelVersion"); - this.labelVersion.Name = "labelVersion"; - // - // labelCopyright - // - resources.ApplyResources(this.labelCopyright, "labelCopyright"); - this.labelCopyright.Name = "labelCopyright"; - // - // okButton - // - resources.ApplyResources(this.okButton, "okButton"); - this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Name = "okButton"; - // - // textBoxDescription - // - resources.ApplyResources(this.textBoxDescription, "textBoxDescription"); - this.textBoxDescription.Name = "textBoxDescription"; - this.textBoxDescription.ReadOnly = true; - this.textBoxDescription.TabStop = false; - // - // linkLabel1 - // - resources.ApplyResources(this.linkLabel1, "linkLabel1"); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.TabStop = true; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); - // - // FormAboutBox - // - this.AcceptButton = this.okButton; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tableLayoutPanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FormAboutBox"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.tableLayoutPanel.ResumeLayout(false); - this.tableLayoutPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; - private System.Windows.Forms.PictureBox logoPictureBox; - private System.Windows.Forms.Label labelProductName; - private System.Windows.Forms.Label labelVersion; - private System.Windows.Forms.Label labelCopyright; - private System.Windows.Forms.TextBox textBoxDescription; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.LinkLabel linkLabel1; - } -} diff --git a/APKToolGUI/FormAboutBox.cs b/APKToolGUI/FormAboutBox.cs deleted file mode 100644 index 07c6509..0000000 --- a/APKToolGUI/FormAboutBox.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Linq; -using System.Reflection; -using System.Windows.Forms; - -namespace APKToolGUI -{ - partial class FormAboutBox : Form - { - public FormAboutBox() - { - InitializeComponent(); - this.Text = String.Format("{0} {1}", this.Text, AssemblyTitle); - this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("{0} {1}", labelVersion.Text, AssemblyVersion); - this.labelCopyright.Text = String.Format("{0} {1}", this.labelCopyright.Text, AssemblyCopyright);// AssemblyCopyright; - //this.labelCompanyName.Text = AssemblyCompany; - this.textBoxDescription.Text = AssemblyDescription; - } - - #region Методы доступа к атрибутам сборки - - public string AssemblyTitle - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); - if (attributes.Length > 0) - { - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; - if (titleAttribute.Title != "") - { - return titleAttribute.Title; - } - } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); - } - } - - public string AssemblyVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - public string AssemblyDescription - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyDescriptionAttribute)attributes[0]).Description; - } - } - - public string AssemblyProduct - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyProductAttribute)attributes[0]).Product; - } - } - - public string AssemblyCopyright - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; - } - } - - public string AssemblyCompany - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCompanyAttribute)attributes[0]).Company; - } - } - #endregion - - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - System.Diagnostics.Process.Start("http://4pda.ru/forum/index.php?showtopic=452034"); - } - } -} diff --git a/APKToolGUI/FormAboutBox.resx b/APKToolGUI/FormAboutBox.resx deleted file mode 100644 index 8679789..0000000 --- a/APKToolGUI/FormAboutBox.resx +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 490, 265 - - - &ОК - - - tableLayoutPanel - - - - Fill - - - 2 - - - FormAboutBox - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 256, 26 - - - 256, 26 - - - 6, 3, 3, 3 - - - Center - - - - 21 - - - labelProductName - - - 6, 0, 3, 0 - - - 6 - - - 256, 26 - - - CenterParent - - - Version - - - textBoxDescription - - - 0 - - - MiddleLeft - - - 219, 259 - - - 12 - - - tableLayoutPanel - - - Bottom, Right - - - Both - - - linkLabel1 - - - labelVersion - - - tableLayoutPanel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 6, 13 - - - 2 - - - 256, 126 - - - Fill - - - MiddleLeft - - - 75, 23 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="linkLabel1" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,46,0039,Percent,53,9961" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> - - - 0 - - - labelCopyright - - - 412, 239 - - - $this - - - tableLayoutPanel - - - okButton - - - Fill - - - 25 - - - Description - - - 19 - - - 231, 78 - - - 0 - - - 6, 0, 3, 0 - - - tableLayoutPanel - - - 256, 26 - - - Product Name - - - 231, 107 - - - MiddleLeft - - - 23 - - - 4 - - - tableLayoutPanel - - - Fill - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 231, 0 - - - 231, 26 - - - 5 - - - Fill - - - 1 - - - 6, 0, 3, 0 - - - 6 - - - logoPictureBox - - - 231, 52 - - - CenterImage - - - 9, 9 - - - tableLayoutPanel - - - Fill - - - 3, 3 - - - 9, 9, 9, 9 - - - Copyright - - - Page - - - About - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MiddleLeft - - - 508, 283 - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - 6, 0, 3, 0 - - - tableLayoutPanel - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 24 - - - True - - - 3 - - - True - - \ No newline at end of file diff --git a/APKToolGUI/FormAboutBox.ru.resx b/APKToolGUI/FormAboutBox.ru.resx deleted file mode 100644 index 3fed6d4..0000000 --- a/APKToolGUI/FormAboutBox.ru.resx +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Название продукта - - - Версия - - - Авторские права - - - Сайт - - - Описание - - - О программе - - \ No newline at end of file diff --git a/APKToolGUI/FormBuild.Designer.cs b/APKToolGUI/FormBuild.Designer.cs deleted file mode 100644 index 35c82ad..0000000 --- a/APKToolGUI/FormBuild.Designer.cs +++ /dev/null @@ -1,381 +0,0 @@ -namespace APKToolGUI -{ - partial class FormBuild - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabelStateImage = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabelStateText = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); - this.groupBoxOptions = new System.Windows.Forms.GroupBox(); - this.textBoxFrameworkPath = new System.Windows.Forms.TextBox(); - this.buttonBrowseFrameworkPath = new System.Windows.Forms.Button(); - this.checkBoxUseFramework = new System.Windows.Forms.CheckBox(); - this.checkBoxCopyOriginal = new System.Windows.Forms.CheckBox(); - this.textBoxAaptPath = new System.Windows.Forms.TextBox(); - this.buttonBrowseAaptPath = new System.Windows.Forms.Button(); - this.checkBoxCustomAapt = new System.Windows.Forms.CheckBox(); - this.checkBoxForceAll = new System.Windows.Forms.CheckBox(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.ColumnImage = new System.Windows.Forms.DataGridViewImageColumn(); - this.ColumnTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.buttonStart = new System.Windows.Forms.Button(); - this.openFileDialogBrowseAapt = new System.Windows.Forms.OpenFileDialog(); - this.saveFileDialogApk = new System.Windows.Forms.SaveFileDialog(); - this.folderBrowserDialogFrameworks = new System.Windows.Forms.FolderBrowserDialog(); - this.textBoxOutputApkPath = new System.Windows.Forms.TextBox(); - this.buttonBrowseOutputApk = new System.Windows.Forms.Button(); - this.statusStrip1.SuspendLayout(); - this.groupBoxOptions.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - this.SuspendLayout(); - // - // statusStrip1 - // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabelStateImage, - this.toolStripStatusLabelStateText, - this.toolStripProgressBar1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 360); - this.statusStrip1.Margin = new System.Windows.Forms.Padding(0, 9, 0, 0); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(570, 22); - this.statusStrip1.TabIndex = 19; - this.statusStrip1.Text = "statusStrip1"; - // - // toolStripStatusLabelStateImage - // - this.toolStripStatusLabelStateImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripStatusLabelStateImage.Name = "toolStripStatusLabelStateImage"; - this.toolStripStatusLabelStateImage.Size = new System.Drawing.Size(0, 17); - this.toolStripStatusLabelStateImage.Text = "toolStripStatusLabel1"; - // - // toolStripStatusLabelStateText - // - this.toolStripStatusLabelStateText.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripStatusLabelStateText.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.toolStripStatusLabelStateText.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripStatusLabelStateText.Name = "toolStripStatusLabelStateText"; - this.toolStripStatusLabelStateText.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.toolStripStatusLabelStateText.Size = new System.Drawing.Size(453, 17); - this.toolStripStatusLabelStateText.Spring = true; - this.toolStripStatusLabelStateText.Text = "Done"; - this.toolStripStatusLabelStateText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // toolStripProgressBar1 - // - this.toolStripProgressBar1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripProgressBar1.AutoSize = false; - this.toolStripProgressBar1.MarqueeAnimationSpeed = 50; - this.toolStripProgressBar1.Name = "toolStripProgressBar1"; - this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16); - this.toolStripProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; - // - // groupBoxOptions - // - this.groupBoxOptions.Controls.Add(this.textBoxFrameworkPath); - this.groupBoxOptions.Controls.Add(this.buttonBrowseFrameworkPath); - this.groupBoxOptions.Controls.Add(this.checkBoxUseFramework); - this.groupBoxOptions.Controls.Add(this.checkBoxCopyOriginal); - this.groupBoxOptions.Controls.Add(this.textBoxAaptPath); - this.groupBoxOptions.Controls.Add(this.buttonBrowseAaptPath); - this.groupBoxOptions.Controls.Add(this.checkBoxCustomAapt); - this.groupBoxOptions.Controls.Add(this.checkBoxForceAll); - this.groupBoxOptions.Location = new System.Drawing.Point(12, 200); - this.groupBoxOptions.Name = "groupBoxOptions"; - this.groupBoxOptions.Size = new System.Drawing.Size(546, 118); - this.groupBoxOptions.TabIndex = 28; - this.groupBoxOptions.TabStop = false; - this.groupBoxOptions.Text = "Options"; - // - // textBoxFrameworkPath - // - this.textBoxFrameworkPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxFrameworkPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "BUILD_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxFrameworkPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "BUILD_FrameworkPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxFrameworkPath.Enabled = global::APKToolGUI.Properties.Settings.Default.BUILD_UseFramework; - this.textBoxFrameworkPath.Location = new System.Drawing.Point(230, 90); - this.textBoxFrameworkPath.Name = "textBoxFrameworkPath"; - this.textBoxFrameworkPath.Size = new System.Drawing.Size(280, 22); - this.textBoxFrameworkPath.TabIndex = 17; - this.textBoxFrameworkPath.Text = global::APKToolGUI.Properties.Settings.Default.BUILD_FrameworkPath; - // - // buttonBrowseFrameworkPath - // - this.buttonBrowseFrameworkPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBrowseFrameworkPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "BUILD_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.buttonBrowseFrameworkPath.Enabled = global::APKToolGUI.Properties.Settings.Default.BUILD_UseFramework; - this.buttonBrowseFrameworkPath.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonBrowseFrameworkPath.Location = new System.Drawing.Point(512, 89); - this.buttonBrowseFrameworkPath.Name = "buttonBrowseFrameworkPath"; - this.buttonBrowseFrameworkPath.Size = new System.Drawing.Size(28, 24); - this.buttonBrowseFrameworkPath.TabIndex = 18; - this.buttonBrowseFrameworkPath.Text = "..."; - this.buttonBrowseFrameworkPath.UseVisualStyleBackColor = true; - this.buttonBrowseFrameworkPath.Click += new System.EventHandler(this.buttonBrowseFrameworkPath_Click); - // - // checkBoxUseFramework - // - this.checkBoxUseFramework.Checked = global::APKToolGUI.Properties.Settings.Default.BUILD_UseFramework; - this.checkBoxUseFramework.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "BUILD_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxUseFramework.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxUseFramework.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxUseFramework.Location = new System.Drawing.Point(6, 91); - this.checkBoxUseFramework.Name = "checkBoxUseFramework"; - this.checkBoxUseFramework.Size = new System.Drawing.Size(218, 18); - this.checkBoxUseFramework.TabIndex = 16; - this.checkBoxUseFramework.Text = "Uses framework files located in"; - this.checkBoxUseFramework.UseVisualStyleBackColor = true; - // - // checkBoxCopyOriginal - // - this.checkBoxCopyOriginal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxCopyOriginal.Checked = global::APKToolGUI.Properties.Settings.Default.BUILD_CopyOriginal; - this.checkBoxCopyOriginal.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "BUILD_CopyOriginal", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxCopyOriginal.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxCopyOriginal.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxCopyOriginal.Location = new System.Drawing.Point(6, 43); - this.checkBoxCopyOriginal.Name = "checkBoxCopyOriginal"; - this.checkBoxCopyOriginal.Size = new System.Drawing.Size(534, 18); - this.checkBoxCopyOriginal.TabIndex = 15; - this.checkBoxCopyOriginal.Text = "Copies original AndroidManifest.xml and META-INF folder into built apk."; - this.checkBoxCopyOriginal.UseVisualStyleBackColor = true; - // - // textBoxAaptPath - // - this.textBoxAaptPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxAaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "BUILD_CustomAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxAaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "BUILD_AaptPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxAaptPath.Enabled = global::APKToolGUI.Properties.Settings.Default.BUILD_CustomAapt; - this.textBoxAaptPath.Location = new System.Drawing.Point(230, 66); - this.textBoxAaptPath.Name = "textBoxAaptPath"; - this.textBoxAaptPath.Size = new System.Drawing.Size(280, 22); - this.textBoxAaptPath.TabIndex = 13; - this.textBoxAaptPath.Text = global::APKToolGUI.Properties.Settings.Default.BUILD_AaptPath; - // - // buttonBrowseAaptPath - // - this.buttonBrowseAaptPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBrowseAaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "BUILD_CustomAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.buttonBrowseAaptPath.Enabled = global::APKToolGUI.Properties.Settings.Default.BUILD_CustomAapt; - this.buttonBrowseAaptPath.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonBrowseAaptPath.Location = new System.Drawing.Point(512, 65); - this.buttonBrowseAaptPath.Name = "buttonBrowseAaptPath"; - this.buttonBrowseAaptPath.Size = new System.Drawing.Size(28, 24); - this.buttonBrowseAaptPath.TabIndex = 14; - this.buttonBrowseAaptPath.Text = "..."; - this.buttonBrowseAaptPath.UseVisualStyleBackColor = true; - this.buttonBrowseAaptPath.Click += new System.EventHandler(this.buttonBsowseAaptPath_Click); - // - // checkBoxCustomAapt - // - this.checkBoxCustomAapt.Checked = global::APKToolGUI.Properties.Settings.Default.BUILD_CustomAapt; - this.checkBoxCustomAapt.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "BUILD_CustomAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxCustomAapt.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxCustomAapt.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxCustomAapt.Location = new System.Drawing.Point(6, 67); - this.checkBoxCustomAapt.Name = "checkBoxCustomAapt"; - this.checkBoxCustomAapt.Size = new System.Drawing.Size(218, 18); - this.checkBoxCustomAapt.TabIndex = 12; - this.checkBoxCustomAapt.Text = "Uses aapt.exe located in"; - this.checkBoxCustomAapt.UseVisualStyleBackColor = true; - // - // checkBoxForceAll - // - this.checkBoxForceAll.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxForceAll.Checked = global::APKToolGUI.Properties.Settings.Default.BUILD_ForceAll; - this.checkBoxForceAll.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "BUILD_ForceAll", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxForceAll.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxForceAll.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxForceAll.Location = new System.Drawing.Point(6, 19); - this.checkBoxForceAll.Name = "checkBoxForceAll"; - this.checkBoxForceAll.Size = new System.Drawing.Size(534, 18); - this.checkBoxForceAll.TabIndex = 0; - this.checkBoxForceAll.Text = "Skip changes detection and build all files"; - this.checkBoxForceAll.UseVisualStyleBackColor = true; - // - // dataGridView1 - // - this.dataGridView1.AllowUserToAddRows = false; - this.dataGridView1.AllowUserToDeleteRows = false; - this.dataGridView1.AllowUserToResizeRows = false; - this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Window; - this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - this.dataGridView1.ColumnHeadersHeight = 24; - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColumnImage, - this.ColumnTime, - this.ColumnMessage}); - this.dataGridView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.dataGridView1.Location = new System.Drawing.Point(12, 12); - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.ReadOnly = true; - this.dataGridView1.RowHeadersVisible = false; - this.dataGridView1.RowTemplate.Height = 19; - this.dataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView1.ShowEditingIcon = false; - this.dataGridView1.Size = new System.Drawing.Size(546, 182); - this.dataGridView1.TabIndex = 26; - // - // ColumnImage - // - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.NullValue = null; - this.ColumnImage.DefaultCellStyle = dataGridViewCellStyle2; - this.ColumnImage.Frozen = true; - this.ColumnImage.HeaderText = ""; - this.ColumnImage.Name = "ColumnImage"; - this.ColumnImage.ReadOnly = true; - this.ColumnImage.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ColumnImage.Width = 20; - // - // ColumnTime - // - this.ColumnTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColumnTime.Frozen = true; - this.ColumnTime.HeaderText = "Time"; - this.ColumnTime.Name = "ColumnTime"; - this.ColumnTime.ReadOnly = true; - this.ColumnTime.Width = 55; - // - // ColumnMessage - // - this.ColumnMessage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColumnMessage.HeaderText = "Message"; - this.ColumnMessage.Name = "ColumnMessage"; - this.ColumnMessage.ReadOnly = true; - // - // buttonStart - // - this.buttonStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStart.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonStart.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonStart.Location = new System.Drawing.Point(438, 325); - this.buttonStart.Name = "buttonStart"; - this.buttonStart.Size = new System.Drawing.Size(120, 24); - this.buttonStart.TabIndex = 27; - this.buttonStart.Text = "Build"; - this.buttonStart.UseVisualStyleBackColor = true; - this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); - // - // openFileDialogBrowseAapt - // - this.openFileDialogBrowseAapt.Filter = "*.exe|*.exe"; - // - // saveFileDialogApk - // - this.saveFileDialogApk.DefaultExt = "apk"; - this.saveFileDialogApk.Filter = "Android App|*.apk"; - // - // folderBrowserDialogFrameworks - // - this.folderBrowserDialogFrameworks.ShowNewFolderButton = false; - // - // textBoxOutputApkPath - // - this.textBoxOutputApkPath.Location = new System.Drawing.Point(12, 326); - this.textBoxOutputApkPath.Name = "textBoxOutputApkPath"; - this.textBoxOutputApkPath.Size = new System.Drawing.Size(390, 22); - this.textBoxOutputApkPath.TabIndex = 29; - // - // buttonBrowseOutputApk - // - this.buttonBrowseOutputApk.Location = new System.Drawing.Point(404, 325); - this.buttonBrowseOutputApk.Name = "buttonBrowseOutputApk"; - this.buttonBrowseOutputApk.Size = new System.Drawing.Size(28, 24); - this.buttonBrowseOutputApk.TabIndex = 30; - this.buttonBrowseOutputApk.Text = "..."; - this.buttonBrowseOutputApk.UseVisualStyleBackColor = true; - this.buttonBrowseOutputApk.Click += new System.EventHandler(this.buttonBrowseOutputApk_Click); - // - // FormBuild - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(570, 382); - this.Controls.Add(this.buttonBrowseOutputApk); - this.Controls.Add(this.textBoxOutputApkPath); - this.Controls.Add(this.groupBoxOptions); - this.Controls.Add(this.dataGridView1); - this.Controls.Add(this.buttonStart); - this.Controls.Add(this.statusStrip1); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.Name = "FormBuild"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "FormBuild"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormBuild_FormClosed); - this.Load += new System.EventHandler(this.FormBuild_Load); - this.Shown += new System.EventHandler(this.FormBuild_Shown); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); - this.groupBoxOptions.ResumeLayout(false); - this.groupBoxOptions.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateImage; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateText; - private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1; - private System.Windows.Forms.GroupBox groupBoxOptions; - private System.Windows.Forms.TextBox textBoxAaptPath; - private System.Windows.Forms.Button buttonBrowseAaptPath; - private System.Windows.Forms.CheckBox checkBoxCustomAapt; - private System.Windows.Forms.CheckBox checkBoxForceAll; - private System.Windows.Forms.DataGridView dataGridView1; - private System.Windows.Forms.DataGridViewImageColumn ColumnImage; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnTime; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnMessage; - private System.Windows.Forms.Button buttonStart; - private System.Windows.Forms.OpenFileDialog openFileDialogBrowseAapt; - private System.Windows.Forms.SaveFileDialog saveFileDialogApk; - private System.Windows.Forms.CheckBox checkBoxCopyOriginal; - private System.Windows.Forms.TextBox textBoxFrameworkPath; - private System.Windows.Forms.Button buttonBrowseFrameworkPath; - private System.Windows.Forms.CheckBox checkBoxUseFramework; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogFrameworks; - private System.Windows.Forms.TextBox textBoxOutputApkPath; - private System.Windows.Forms.Button buttonBrowseOutputApk; - } -} \ No newline at end of file diff --git a/APKToolGUI/FormBuild.cs b/APKToolGUI/FormBuild.cs deleted file mode 100644 index 4d3b4c5..0000000 --- a/APKToolGUI/FormBuild.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace APKToolGUI -{ - public partial class FormBuild : Form - { - public FormBuild(string[] args) - { - Program.SetLanguage(); - InitializeComponent(); - this.Icon = Properties.Resources.android_thin; - this.Text = Application.ProductName; - projectDir = args[1]; - } - - private string projectDir; - private Apktool apktool; - private Apktool apktoolSync; - - bool StartButtonEnabled - { - set - { - if (buttonStart.InvokeRequired) - buttonStart.BeginInvoke(new Action(() => - { - buttonStart.Enabled = value; - })); - else - buttonStart.Enabled = value; - } - } - ProgressBarStyle progressBarStyle - { - set - { - if (toolStripProgressBar1.GetCurrentParent().InvokeRequired) - { - toolStripProgressBar1.GetCurrentParent().BeginInvoke(new Action(() => - { - toolStripProgressBar1.Style = value; - })); - } - else - toolStripProgressBar1.Style = value; - } - } - - private void ToLog(string time, string message, Image statusImage, Color backColor) - { - if (dataGridView1.InvokeRequired) - dataGridView1.BeginInvoke(new Action(() => - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - })); - else - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - } - } - - private void ToLog(ApktoolEventType eventType, String message) - { - switch (eventType) - { - case ApktoolEventType.Information: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.info, Color.FromKnownColor(KnownColor.Window)); - //ToStatus(result.Message, Properties.Resources.info); - break; - case ApktoolEventType.Error: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.error, Color.FromKnownColor(KnownColor.LightPink)); - //ToStatus(result.Message, Properties.Resources.error); - break; - case ApktoolEventType.Warning: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.warning, Color.FromKnownColor(KnownColor.LightYellow)); - //ToStatus(result.Message, Properties.Resources.warning); - break; - default: - break; - } - } - - #region Form event handlers - - private void FormBuild_Load(object sender, EventArgs e) - { - if (String.IsNullOrEmpty(Properties.Settings.Default.JavaExe)) - { - MessageBox.Show("Java location is not specified in the settings. Please, configure program first.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - this.Close(); - } - if (!System.IO.File.Exists(Program.APKTOOL_PATH)) - { - MessageBox.Show(String.Format("apktool не найден в каталоге назначения '{0}'.", Program.APKTOOL_PATH), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - this.Close(); - } - - apktoolSync = new Apktool(Properties.Settings.Default.JavaExe, Program.APKTOOL_PATH); - apktool = new Apktool(Properties.Settings.Default.JavaExe, Program.APKTOOL_PATH); - apktool.ApktoolOutputDataRecieved += apktool_ApktoolOutputDataRecieved; - apktool.ApktoolErrorDataRecieved += apktool_ApktoolErrorDataRecieved; - apktool.BuildCompleted += apktool_BuildCompleted; - } - - private void FormBuild_Shown(object sender, EventArgs e) - { - this.Update(); - - textBoxOutputApkPath.Text = String.Format("{0}\\{1}_{2}.apk", System.IO.Path.GetDirectoryName(projectDir), projectDir.Replace(System.IO.Path.GetDirectoryName(projectDir) + "\\", String.Empty), DateTime.Now.ToString("yyyyMMdd_HH-mm-ss"), System.IO.Path.GetExtension(projectDir)); - - Version javaVersion = apktool.GetJavaVersion(); - if (javaVersion != null) - { - ToLog(ApktoolEventType.Information, String.Format("Java version \"{0} Update {1}\"", javaVersion.Minor, javaVersion.Revision)); - string apktoolVersion = apktool.GetVersion(); - if (!String.IsNullOrWhiteSpace(apktoolVersion)) - ToLog(ApktoolEventType.Information, String.Format("Apktool version \"{0}\"", apktoolVersion)); - else - ToLog(ApktoolEventType.Error, "Can't detect apktool version."); - } - else - MessageBox.Show(Language.ErrorJavaDetect, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - private void FormBuild_FormClosed(object sender, FormClosedEventArgs e) - { - Properties.Settings.Default.Save(); - } - - #endregion - - #region apktool event handlers - void apktool_ApktoolOutputDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - ToLog(e.EventType, e.Message); - } - - void apktool_ApktoolErrorDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - ToLog(e.EventType, e.Message); - } - - void apktool_BuildCompleted(object sender, ApktoolEventCompletedEventArgs e) - { - if (e.ExitCode == 0) - ToLog(ApktoolEventType.Information, "Сборка успешно завршена."); - else - ToLog(ApktoolEventType.Warning, String.Format("Внимание! При сборке приложения произошла ошибка. Код выхода: '{0}'.", e.ExitCode)); - StartButtonEnabled = true; - progressBarStyle = ProgressBarStyle.Continuous; - } - #endregion - - private void buttonBsowseAaptPath_Click(object sender, EventArgs e) - { - if (openFileDialogBrowseAapt.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxAaptPath.Text = openFileDialogBrowseAapt.FileName; - } - - private void buttonBrowseFrameworkPath_Click(object sender, EventArgs e) - { - if (folderBrowserDialogFrameworks.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxFrameworkPath.Text = folderBrowserDialogFrameworks.SelectedPath; - } - - 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; - } - - } - - private void buttonBrowseOutputApk_Click(object sender, EventArgs e) - { - saveFileDialogApk.InitialDirectory = System.IO.Path.GetDirectoryName(projectDir); - string foldername = projectDir.Replace(System.IO.Path.GetDirectoryName(projectDir) + "\\", String.Empty); - saveFileDialogApk.FileName = String.Format("{0}_{1}", foldername, DateTime.Now.ToString("yyyyMMdd_HH-mm-ss")); - if (saveFileDialogApk.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxOutputApkPath.Text = saveFileDialogApk.FileName; - } - } -} diff --git a/APKToolGUI/FormBuild.resx b/APKToolGUI/FormBuild.resx deleted file mode 100644 index 4f10a29..0000000 --- a/APKToolGUI/FormBuild.resx +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3 - - - True - - - True - - - True - - - True - - - True - - - True - - - 119, 3 - - - 317, 3 - - - 468, 3 - - - 29 - - \ No newline at end of file diff --git a/APKToolGUI/FormDecode.Designer.cs b/APKToolGUI/FormDecode.Designer.cs deleted file mode 100644 index 0eeaff2..0000000 --- a/APKToolGUI/FormDecode.Designer.cs +++ /dev/null @@ -1,383 +0,0 @@ -namespace APKToolGUI -{ - partial class FormDecode - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormDecode)); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabelStateImage = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabelStateText = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.ColumnImage = new System.Windows.Forms.DataGridViewImageColumn(); - this.ColumnTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.buttonStart = new System.Windows.Forms.Button(); - this.groupBoxOptions = new System.Windows.Forms.GroupBox(); - this.checkBoxMatchOriginal = new System.Windows.Forms.CheckBox(); - this.checkBoxKeepBrokenResource = new System.Windows.Forms.CheckBox(); - this.textBoxFrameworkPath = new System.Windows.Forms.TextBox(); - this.buttonFramePath = new System.Windows.Forms.Button(); - this.checkBoxFrameworkPath = new System.Windows.Forms.CheckBox(); - this.checkBoxForce = new System.Windows.Forms.CheckBox(); - this.checkBoxNoRes = new System.Windows.Forms.CheckBox(); - this.checkBoxNoSrc = new System.Windows.Forms.CheckBox(); - this.folderBrowserDialogFrameworks = new System.Windows.Forms.FolderBrowserDialog(); - this.folderBrowserDialogProjectDir = new System.Windows.Forms.FolderBrowserDialog(); - this.textBoxOutputProjectDir = new System.Windows.Forms.TextBox(); - this.buttonBrowseOutputProjectDir = new System.Windows.Forms.Button(); - this.statusStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - this.groupBoxOptions.SuspendLayout(); - this.SuspendLayout(); - // - // statusStrip1 - // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabelStateImage, - this.toolStripStatusLabelStateText, - this.toolStripProgressBar1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 408); - this.statusStrip1.Margin = new System.Windows.Forms.Padding(0, 9, 0, 0); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(570, 22); - this.statusStrip1.TabIndex = 22; - this.statusStrip1.Text = "statusStrip1"; - // - // toolStripStatusLabelStateImage - // - this.toolStripStatusLabelStateImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripStatusLabelStateImage.Name = "toolStripStatusLabelStateImage"; - this.toolStripStatusLabelStateImage.Size = new System.Drawing.Size(0, 17); - this.toolStripStatusLabelStateImage.Text = "toolStripStatusLabel1"; - // - // toolStripStatusLabelStateText - // - this.toolStripStatusLabelStateText.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripStatusLabelStateText.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.toolStripStatusLabelStateText.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; - this.toolStripStatusLabelStateText.Name = "toolStripStatusLabelStateText"; - this.toolStripStatusLabelStateText.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.toolStripStatusLabelStateText.Size = new System.Drawing.Size(453, 17); - this.toolStripStatusLabelStateText.Spring = true; - this.toolStripStatusLabelStateText.Text = "Done"; - this.toolStripStatusLabelStateText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // toolStripProgressBar1 - // - this.toolStripProgressBar1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripProgressBar1.AutoSize = false; - this.toolStripProgressBar1.MarqueeAnimationSpeed = 50; - this.toolStripProgressBar1.Name = "toolStripProgressBar1"; - this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16); - this.toolStripProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; - // - // dataGridView1 - // - this.dataGridView1.AllowUserToAddRows = false; - this.dataGridView1.AllowUserToDeleteRows = false; - this.dataGridView1.AllowUserToResizeRows = false; - this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Window; - this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - this.dataGridView1.ColumnHeadersHeight = 24; - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColumnImage, - this.ColumnTime, - this.ColumnMessage}); - this.dataGridView1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.dataGridView1.Location = new System.Drawing.Point(12, 12); - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.ReadOnly = true; - this.dataGridView1.RowHeadersVisible = false; - this.dataGridView1.RowTemplate.Height = 19; - this.dataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView1.ShowEditingIcon = false; - this.dataGridView1.Size = new System.Drawing.Size(546, 182); - this.dataGridView1.TabIndex = 25; - // - // ColumnImage - // - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.NullValue = ((object)(resources.GetObject("dataGridViewCellStyle1.NullValue"))); - this.ColumnImage.DefaultCellStyle = dataGridViewCellStyle1; - this.ColumnImage.Frozen = true; - this.ColumnImage.HeaderText = ""; - this.ColumnImage.Name = "ColumnImage"; - this.ColumnImage.ReadOnly = true; - this.ColumnImage.Resizable = System.Windows.Forms.DataGridViewTriState.False; - this.ColumnImage.Width = 20; - // - // ColumnTime - // - this.ColumnTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColumnTime.Frozen = true; - this.ColumnTime.HeaderText = "Time"; - this.ColumnTime.Name = "ColumnTime"; - this.ColumnTime.ReadOnly = true; - this.ColumnTime.Width = 55; - // - // ColumnMessage - // - this.ColumnMessage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColumnMessage.HeaderText = "Message"; - this.ColumnMessage.Name = "ColumnMessage"; - this.ColumnMessage.ReadOnly = true; - // - // buttonStart - // - this.buttonStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStart.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonStart.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonStart.Location = new System.Drawing.Point(438, 371); - this.buttonStart.Margin = new System.Windows.Forms.Padding(3, 3, 3, 12); - this.buttonStart.Name = "buttonStart"; - this.buttonStart.Size = new System.Drawing.Size(120, 24); - this.buttonStart.TabIndex = 27; - this.buttonStart.Text = "Decompile"; - this.buttonStart.UseVisualStyleBackColor = true; - this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); - // - // groupBoxOptions - // - this.groupBoxOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxOptions.Controls.Add(this.checkBoxMatchOriginal); - this.groupBoxOptions.Controls.Add(this.checkBoxKeepBrokenResource); - this.groupBoxOptions.Controls.Add(this.textBoxFrameworkPath); - this.groupBoxOptions.Controls.Add(this.buttonFramePath); - this.groupBoxOptions.Controls.Add(this.checkBoxFrameworkPath); - this.groupBoxOptions.Controls.Add(this.checkBoxForce); - this.groupBoxOptions.Controls.Add(this.checkBoxNoRes); - this.groupBoxOptions.Controls.Add(this.checkBoxNoSrc); - this.groupBoxOptions.Location = new System.Drawing.Point(12, 200); - this.groupBoxOptions.Name = "groupBoxOptions"; - this.groupBoxOptions.Size = new System.Drawing.Size(546, 166); - this.groupBoxOptions.TabIndex = 26; - this.groupBoxOptions.TabStop = false; - this.groupBoxOptions.Text = "Options"; - // - // checkBoxMatchOriginal - // - this.checkBoxMatchOriginal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxMatchOriginal.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_MatchOriginal; - this.checkBoxMatchOriginal.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_MatchOriginal", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxMatchOriginal.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxMatchOriginal.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxMatchOriginal.Location = new System.Drawing.Point(6, 115); - this.checkBoxMatchOriginal.Name = "checkBoxMatchOriginal"; - this.checkBoxMatchOriginal.Size = new System.Drawing.Size(534, 18); - this.checkBoxMatchOriginal.TabIndex = 13; - this.checkBoxMatchOriginal.Text = "Keeps files to closest to original as possible. Prevents rebuild."; - this.checkBoxMatchOriginal.UseVisualStyleBackColor = true; - // - // checkBoxKeepBrokenResource - // - this.checkBoxKeepBrokenResource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxKeepBrokenResource.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_KeepBrokenResource; - this.checkBoxKeepBrokenResource.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_KeepBrokenResource", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxKeepBrokenResource.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxKeepBrokenResource.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxKeepBrokenResource.Location = new System.Drawing.Point(6, 91); - this.checkBoxKeepBrokenResource.Name = "checkBoxKeepBrokenResource"; - this.checkBoxKeepBrokenResource.Size = new System.Drawing.Size(534, 18); - this.checkBoxKeepBrokenResource.TabIndex = 12; - this.checkBoxKeepBrokenResource.Text = "Keep broken resource"; - this.checkBoxKeepBrokenResource.UseVisualStyleBackColor = true; - // - // textBoxFrameworkPath - // - this.textBoxFrameworkPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxFrameworkPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBoxFrameworkPath.Enabled = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_UseFramework; - this.textBoxFrameworkPath.Location = new System.Drawing.Point(230, 138); - this.textBoxFrameworkPath.Name = "textBoxFrameworkPath"; - this.textBoxFrameworkPath.Size = new System.Drawing.Size(280, 22); - this.textBoxFrameworkPath.TabIndex = 10; - // - // buttonFramePath - // - this.buttonFramePath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFramePath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.buttonFramePath.Enabled = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_UseFramework; - this.buttonFramePath.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonFramePath.Location = new System.Drawing.Point(512, 137); - this.buttonFramePath.Name = "buttonFramePath"; - this.buttonFramePath.Size = new System.Drawing.Size(28, 24); - this.buttonFramePath.TabIndex = 11; - this.buttonFramePath.Text = "..."; - this.buttonFramePath.UseVisualStyleBackColor = true; - this.buttonFramePath.Click += new System.EventHandler(this.buttonFramePath_Click); - // - // checkBoxFrameworkPath - // - this.checkBoxFrameworkPath.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_UseFramework; - this.checkBoxFrameworkPath.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxFrameworkPath.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxFrameworkPath.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxFrameworkPath.Location = new System.Drawing.Point(6, 139); - this.checkBoxFrameworkPath.Name = "checkBoxFrameworkPath"; - this.checkBoxFrameworkPath.Size = new System.Drawing.Size(218, 18); - this.checkBoxFrameworkPath.TabIndex = 9; - this.checkBoxFrameworkPath.Text = "Uses framework files located in"; - this.checkBoxFrameworkPath.UseVisualStyleBackColor = true; - // - // checkBoxForce - // - this.checkBoxForce.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxForce.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_Force; - this.checkBoxForce.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_Force", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxForce.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxForce.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxForce.Location = new System.Drawing.Point(6, 67); - this.checkBoxForce.Name = "checkBoxForce"; - this.checkBoxForce.Size = new System.Drawing.Size(534, 18); - this.checkBoxForce.TabIndex = 8; - this.checkBoxForce.Text = "Force delete destination directory"; - this.checkBoxForce.UseVisualStyleBackColor = true; - // - // checkBoxNoRes - // - this.checkBoxNoRes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxNoRes.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_NoRes; - this.checkBoxNoRes.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_NoRes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxNoRes.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxNoRes.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxNoRes.Location = new System.Drawing.Point(6, 43); - this.checkBoxNoRes.Name = "checkBoxNoRes"; - this.checkBoxNoRes.Size = new System.Drawing.Size(534, 18); - this.checkBoxNoRes.TabIndex = 7; - this.checkBoxNoRes.Text = "Do not decode resources"; - this.checkBoxNoRes.UseVisualStyleBackColor = true; - // - // checkBoxNoSrc - // - this.checkBoxNoSrc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxNoSrc.Checked = global::APKToolGUI.Properties.Settings.Default.DECOMPILE_NoSrc; - this.checkBoxNoSrc.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "DECOMPILE_NoSrc", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.checkBoxNoSrc.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBoxNoSrc.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBoxNoSrc.Location = new System.Drawing.Point(6, 19); - this.checkBoxNoSrc.Name = "checkBoxNoSrc"; - this.checkBoxNoSrc.Size = new System.Drawing.Size(534, 18); - this.checkBoxNoSrc.TabIndex = 6; - this.checkBoxNoSrc.Text = "Do not decode sources"; - this.checkBoxNoSrc.UseVisualStyleBackColor = true; - // - // folderBrowserDialogFrameworks - // - this.folderBrowserDialogFrameworks.ShowNewFolderButton = false; - // - // textBoxOutputProjectDir - // - this.textBoxOutputProjectDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxOutputProjectDir.Location = new System.Drawing.Point(12, 372); - this.textBoxOutputProjectDir.Name = "textBoxOutputProjectDir"; - this.textBoxOutputProjectDir.Size = new System.Drawing.Size(390, 22); - this.textBoxOutputProjectDir.TabIndex = 28; - // - // buttonBrowseOutputProjectDir - // - this.buttonBrowseOutputProjectDir.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBrowseOutputProjectDir.Location = new System.Drawing.Point(404, 371); - this.buttonBrowseOutputProjectDir.Name = "buttonBrowseOutputProjectDir"; - this.buttonBrowseOutputProjectDir.Size = new System.Drawing.Size(28, 24); - this.buttonBrowseOutputProjectDir.TabIndex = 29; - this.buttonBrowseOutputProjectDir.Text = "..."; - this.buttonBrowseOutputProjectDir.UseVisualStyleBackColor = true; - this.buttonBrowseOutputProjectDir.Click += new System.EventHandler(this.buttonBrowseOutputProjectDir_Click); - // - // FormDecode - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(570, 430); - this.Controls.Add(this.buttonBrowseOutputProjectDir); - this.Controls.Add(this.textBoxOutputProjectDir); - this.Controls.Add(this.dataGridView1); - this.Controls.Add(this.buttonStart); - this.Controls.Add(this.groupBoxOptions); - this.Controls.Add(this.statusStrip1); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.Name = "FormDecode"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "FormDecode"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormDecompile_FormClosed); - this.Load += new System.EventHandler(this.FormDecompile_Load); - this.Shown += new System.EventHandler(this.FormDecompile_Shown); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - this.groupBoxOptions.ResumeLayout(false); - this.groupBoxOptions.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateImage; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateText; - private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1; - private System.Windows.Forms.DataGridView dataGridView1; - private System.Windows.Forms.DataGridViewImageColumn ColumnImage; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnTime; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnMessage; - private System.Windows.Forms.Button buttonStart; - private System.Windows.Forms.GroupBox groupBoxOptions; - private System.Windows.Forms.TextBox textBoxFrameworkPath; - private System.Windows.Forms.Button buttonFramePath; - private System.Windows.Forms.CheckBox checkBoxFrameworkPath; - private System.Windows.Forms.CheckBox checkBoxForce; - private System.Windows.Forms.CheckBox checkBoxNoRes; - private System.Windows.Forms.CheckBox checkBoxNoSrc; - private System.Windows.Forms.CheckBox checkBoxMatchOriginal; - private System.Windows.Forms.CheckBox checkBoxKeepBrokenResource; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogFrameworks; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogProjectDir; - private System.Windows.Forms.TextBox textBoxOutputProjectDir; - private System.Windows.Forms.Button buttonBrowseOutputProjectDir; - } -} \ No newline at end of file diff --git a/APKToolGUI/FormDecode.cs b/APKToolGUI/FormDecode.cs deleted file mode 100644 index 6de2a6a..0000000 --- a/APKToolGUI/FormDecode.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace APKToolGUI -{ - public partial class FormDecode : Form - { - public FormDecode(string[] args) - { - Program.SetLanguage(); - InitializeComponent(); - this.Icon = Properties.Resources.android_thin; - this.Text = Application.ProductName; - - textBoxOutputProjectDir.Multiline = true; - textBoxOutputProjectDir.MinimumSize = new Size(textBoxOutputProjectDir.Size.Width, textBoxOutputProjectDir.Size.Height); - textBoxOutputProjectDir.Size = new Size(textBoxOutputProjectDir.Size.Width, textBoxOutputProjectDir.Size.Height); - textBoxOutputProjectDir.Multiline = false; - - this.apkPath = args[1]; - } - - private string apkPath; - private Apktool apktool; - private Apktool apktoolSync; - bool StartButtonEnabled - { - set - { - if (buttonStart.InvokeRequired) - buttonStart.BeginInvoke(new Action(() => - { - buttonStart.Enabled = value; - })); - else - buttonStart.Enabled = value; - } - } - ProgressBarStyle progressBarStyle - { - set - { - if (toolStripProgressBar1.GetCurrentParent().InvokeRequired) - { - toolStripProgressBar1.GetCurrentParent().BeginInvoke(new Action(() => - { - toolStripProgressBar1.Style = value; - })); - } - else - toolStripProgressBar1.Style = value; - } - } - - private void ToLog(string time, string message, Image statusImage, Color backColor) - { - if (dataGridView1.InvokeRequired) - dataGridView1.BeginInvoke(new Action(() => - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - })); - else - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - } - } - - private void ToLog(ApktoolEventType eventType, String message) - { - switch (eventType) - { - case ApktoolEventType.Information: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.info, Color.FromKnownColor(KnownColor.Window)); - //ToStatus(result.Message, Properties.Resources.info); - break; - case ApktoolEventType.Error: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.error, Color.FromKnownColor(KnownColor.LightPink)); - //ToStatus(result.Message, Properties.Resources.error); - break; - case ApktoolEventType.Warning: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.warning, Color.FromKnownColor(KnownColor.LightYellow)); - //ToStatus(result.Message, Properties.Resources.warning); - break; - default: - break; - } - } - - #region Form event handlers - - private void FormDecompile_Load(object sender, EventArgs e) - { - if (String.IsNullOrEmpty(Properties.Settings.Default.JavaExe)) - { - MessageBox.Show("Java location is not specified in the settings. Please, configure program first.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - this.Close(); - } - if (!System.IO.File.Exists(Program.APKTOOL_PATH)) - { - MessageBox.Show(String.Format("Apktool not fount in '{0}'.", Program.APKTOOL_PATH), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - this.Close(); - } - - //apktoolSync = new Apktool(Properties.Settings.Default.JavaExe, Program.APKTOOL_PATH); - apktool = new Apktool(Properties.Settings.Default.JavaExe, Program.APKTOOL_PATH); - apktool.ApktoolOutputDataRecieved += apktool_ApktoolOutputDataRecieved; - apktool.ApktoolErrorDataRecieved += apktool_ApktoolErrorDataRecieved; - apktool.DecompilingCompleted += apktool_DecompilingCompleted; - } - - private void FormDecompile_Shown(object sender, EventArgs e) - { - this.Update(); - - textBoxOutputProjectDir.Text = System.IO.Path.GetDirectoryName(apkPath) + "\\" + System.IO.Path.GetFileNameWithoutExtension(apkPath); - - Version javaVersion = apktool.GetJavaVersion(); - if (javaVersion != null) - { - ToLog(ApktoolEventType.Information, String.Format("Java version \"{0} Update {1}\"", javaVersion.Minor, javaVersion.Revision)); - string apktoolVersion = apktool.GetVersion(); - if (!String.IsNullOrWhiteSpace(apktoolVersion)) - ToLog(ApktoolEventType.Information, String.Format("Apktool version \"{0}\"", apktoolVersion)); - else - ToLog(ApktoolEventType.Error, "Can't detect apktool version."); - } - else - MessageBox.Show(Language.ErrorJavaDetect, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - private void FormDecompile_FormClosed(object sender, FormClosedEventArgs e) - { - Properties.Settings.Default.Save(); - } - - #endregion - - #region apktool event handlers - - void apktool_ApktoolOutputDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - ToLog(e.EventType, e.Message); - } - - void apktool_ApktoolErrorDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - ToLog(e.EventType, e.Message); - } - - void apktool_DecompilingCompleted(object sender, ApktoolEventCompletedEventArgs e) - { - if (e.ExitCode == 0) - ToLog(ApktoolEventType.Information, "Декомпиляция успешно завршена."); - else - ToLog(ApktoolEventType.Warning, String.Format("Внимание! При декомпиляции приложения произошла ошибка. Код выхода: '{0}'.", e.ExitCode)); - StartButtonEnabled = true; - progressBarStyle = ProgressBarStyle.Continuous; - } - - #endregion - - private void buttonFramePath_Click(object sender, EventArgs e) - { - if (folderBrowserDialogFrameworks.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxFrameworkPath.Text = folderBrowserDialogFrameworks.SelectedPath; - } - - private void buttonStart_Click(object sender, EventArgs e) - { - DecompileOptions options = new DecompileOptions(apkPath); - options.NoResource = checkBoxNoRes.Checked; - options.NoSource = checkBoxNoSrc.Checked; - options.Force = checkBoxForce.Checked; - options.KeepBrokenResource = checkBoxKeepBrokenResource.Checked; - options.MatchOriginal = checkBoxMatchOriginal.Checked; - if (checkBoxFrameworkPath.Checked) - { - if (System.IO.Directory.Exists(textBoxFrameworkPath.Text)) - options.FrameworkPath = textBoxFrameworkPath.Text; - else - { - MessageBox.Show("Указанной директорию расположения фреймворков не существует.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - } - - options.OutputDirectory = textBoxOutputProjectDir.Text; - - bool started = false; -#if !DEBUG - try - { -#endif - started = apktool.Decompile(options); -#if !DEBUG - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } -#endif - if (started) - { - progressBarStyle = ProgressBarStyle.Marquee; - StartButtonEnabled = false; - } - } - - private void buttonBrowseOutputProjectDir_Click(object sender, EventArgs e) - { - folderBrowserDialogProjectDir.SelectedPath = System.IO.Path.GetDirectoryName(apkPath); - if (folderBrowserDialogProjectDir.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxOutputProjectDir.Text = folderBrowserDialogProjectDir.SelectedPath; - } - } -} \ No newline at end of file diff --git a/APKToolGUI/FormDecode.resx b/APKToolGUI/FormDecode.resx deleted file mode 100644 index a4c8165..0000000 --- a/APKToolGUI/FormDecode.resx +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5, 7 - - - True - - - - - Qk32AgAAAAAAADYAAAAoAAAADgAAABAAAAABABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEgoTGw8bGw8bGw8bGw8bGw8bGw8bG - w8bGw8bGw8bGw8bGw8bGw8YAAAAAAISChP///////////////////////////////////////////8bD - xgAAAAAAhIKE////////////////////////////////////////////xsPGAAAAAACEgoT///////// - ///////////////////////////////////Gw8YAAAAAAISChP////////////////////////////// - /////////////8bDxgAAAAAAhIKE////////////AAD/AAD/////////AAD/AAD/////////xsPGAAAA - AACEgoT///////////////8AAP8AAP8AAP8AAP/////////////Gw8YAAAAAAISChP////////////// - /////wAA/wAA/////////////////8bDxgAAAAAAhIKE////////////////AAD/AAD/AAD/AAD///// - ////////xsPGAAAAAACEgoT///////////8AAP8AAP////////8AAP8AAP/////////Gw8YAAAAAAISC - hP///////////////////////////////////////////8bDxgAAAAAAhIKE//////////////////// - ////////////////////////xsPGAAAAAACEgoT///////////////////////////////////////// - ///Gw8YAAAAAAISChP///////////////////////////////////////////8bDxgAAAAAAhIKEhIKE - hIKEhIKEhIKEhIKEhIKEhIKEhIKEhIKEhIKEhIKEhIKEhIKEAAA= - - - - True - - - True - - - 108, 11 - - - 336, 11 - - - 29 - - \ No newline at end of file diff --git a/APKToolGUI/FormMain.Designer.cs b/APKToolGUI/FormMain.Designer.cs deleted file mode 100644 index 9cb68f0..0000000 --- a/APKToolGUI/FormMain.Designer.cs +++ /dev/null @@ -1,1219 +0,0 @@ -namespace APKToolGUI -{ - partial class FormMain - { - /// - /// Требуется переменная конструктора. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Освободить все используемые ресурсы. - /// - /// истинно, если управляемый ресурс должен быть удален; иначе ложно. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Код, автоматически созданный конструктором форм Windows - - /// - /// Обязательный метод для поддержки конструктора - не изменяйте - /// содержимое данного метода при помощи редактора кода. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - this.button_DECODE_BrowseInputAppPath = new System.Windows.Forms.Button(); - this.button_DECODE_Decode = new System.Windows.Forms.Button(); - this.tabControlMain = new System.Windows.Forms.TabControl(); - this.tabPageDecode = new System.Windows.Forms.TabPage(); - this.groupBox_DECODE_Options = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel_DECODE_Options = new System.Windows.Forms.TableLayoutPanel(); - this.checkBox_DECODE_MatchOriginal = new System.Windows.Forms.CheckBox(); - this.checkBox_DECODE_KeepBrokenRes = new System.Windows.Forms.CheckBox(); - this.checkBox_DECODE_Force = new System.Windows.Forms.CheckBox(); - this.checkBox_DECODE_NoRes = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanelDecodeOutputDir = new System.Windows.Forms.TableLayoutPanel(); - this.button_DECODE_BrowseOutputDirectory = new System.Windows.Forms.Button(); - this.checkBox_DECODE_OutputDirectory = new System.Windows.Forms.CheckBox(); - this.textBox_DECODE_OutputDirectory = new System.Windows.Forms.TextBox(); - this.tableLayoutPanelDecodeUseFramework = new System.Windows.Forms.TableLayoutPanel(); - this.textBox_DECODE_FrameDir = new System.Windows.Forms.TextBox(); - this.checkBox_DECODE_UseFramework = new System.Windows.Forms.CheckBox(); - this.button_DECODE_BrowseFrameDir = new System.Windows.Forms.Button(); - this.checkBox_DECODE_NoSrc = new System.Windows.Forms.CheckBox(); - this.textBox_DECODE_InputAppPath = new System.Windows.Forms.TextBox(); - this.tabPageBuild = new System.Windows.Forms.TabPage(); - this.groupBox_BUILD_Options = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel_BUILD_Options = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanelBuildOutputApk = new System.Windows.Forms.TableLayoutPanel(); - this.button_BUILD_BrowseOutputAppPath = new System.Windows.Forms.Button(); - this.checkBox_BUILD_OutputAppPath = new System.Windows.Forms.CheckBox(); - this.textBox_BUILD_OutputAppPath = new System.Windows.Forms.TextBox(); - this.checkBox_BUILD_CopyOriginal = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanelBuildUseFramework = new System.Windows.Forms.TableLayoutPanel(); - this.button_BUILD_BrowseFrameDir = new System.Windows.Forms.Button(); - this.checkBox_BUILD_UseFramework = new System.Windows.Forms.CheckBox(); - this.textBox_BUILD_FrameDir = new System.Windows.Forms.TextBox(); - this.tableLayoutPanelBuildUseAapt = new System.Windows.Forms.TableLayoutPanel(); - this.textBox_BUILD_AaptPath = new System.Windows.Forms.TextBox(); - this.checkBox_BUILD_UseAapt = new System.Windows.Forms.CheckBox(); - this.button_BUILD_BrowseAaptPath = new System.Windows.Forms.Button(); - this.checkBox_BUILD_ForceAll = new System.Windows.Forms.CheckBox(); - this.button_BUILD_BrowseInputProjectDir = new System.Windows.Forms.Button(); - this.button_BUILD_Build = new System.Windows.Forms.Button(); - this.textBox_BUILD_InputProjectDir = new System.Windows.Forms.TextBox(); - this.tabPageInstallFramework = new System.Windows.Forms.TabPage(); - this.groupBox_IF_Options = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel_IF_Options = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel_IF_Tag = new System.Windows.Forms.TableLayoutPanel(); - this.checkBox_IF_Tag = new System.Windows.Forms.CheckBox(); - this.textBox_IF_Tag = new System.Windows.Forms.TextBox(); - this.tableLayoutPanel_IF_FramePath = new System.Windows.Forms.TableLayoutPanel(); - this.textBox_IF_FrameDir = new System.Windows.Forms.TextBox(); - this.checkBox_IF_FramePath = new System.Windows.Forms.CheckBox(); - this.button_IF_BrowseFrameDir = new System.Windows.Forms.Button(); - this.button_IF_InstallFramework = new System.Windows.Forms.Button(); - this.button_IF_BrowseInputFramePath = new System.Windows.Forms.Button(); - this.textBox_IF_InputFramePath = new System.Windows.Forms.TextBox(); - this.tabPageSign = new System.Windows.Forms.TabPage(); - this.groupBox_SIGN_Options = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel_SIGN_Options = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel_SIGN_PrivateKey = new System.Windows.Forms.TableLayoutPanel(); - this.label_SIGN_PrivateKey = new System.Windows.Forms.Label(); - this.button_SIGN_BrowsePrivateKey = new System.Windows.Forms.Button(); - this.textBox_SIGN_PrivateKey = new System.Windows.Forms.TextBox(); - this.tableLayoutPanel_SIGN_PublicKey = new System.Windows.Forms.TableLayoutPanel(); - this.label_SIGN_PublicKey = new System.Windows.Forms.Label(); - this.button_SIGN_BrowsePublicKey = new System.Windows.Forms.Button(); - this.textBox_SIGN_PublicKey = new System.Windows.Forms.TextBox(); - this.tableLayoutPanel_SIGN_OutputFile = new System.Windows.Forms.TableLayoutPanel(); - this.label_SIGN_OutputFile = new System.Windows.Forms.Label(); - this.button_SIGN_BrowseOutputFile = new System.Windows.Forms.Button(); - this.textBox_SIGN_OutputFile = new System.Windows.Forms.TextBox(); - this.textBox_SIGN_InputFile = new System.Windows.Forms.TextBox(); - this.button_SIGN_BrowseInputFile = new System.Windows.Forms.Button(); - this.button_SIGN_Sign = new System.Windows.Forms.Button(); - this.tabPageZipAlign = new System.Windows.Forms.TabPage(); - this.groupBox_ZIPALIGN_Options = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel_ZIPALIGN_Options = new System.Windows.Forms.TableLayoutPanel(); - this.checkBox_ZIPALIGN_Recompress = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes = new System.Windows.Forms.TableLayoutPanel(); - this.label_ZIPALIGN_AlignmentBytes = new System.Windows.Forms.Label(); - this.numericUpDown_ZIPALIGN_AlignmentBytes = new System.Windows.Forms.NumericUpDown(); - this.checkBox_ZIPALIGN_VerboseOutput = new System.Windows.Forms.CheckBox(); - this.checkBox_ZIPALIGN_CheckAlignment = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel_ZIPALIGN_OutputFile = new System.Windows.Forms.TableLayoutPanel(); - this.label_ZIPALIGN_OutputFile = new System.Windows.Forms.Label(); - this.button_ZIPALIGN_BrowseOutputFile = new System.Windows.Forms.Button(); - this.textBox_ZIPALIGN_OutputFile = new System.Windows.Forms.TextBox(); - this.checkBox_ZIPALIGN_OverwriteOutputFile = new System.Windows.Forms.CheckBox(); - this.button_ZIPALIGN_Align = new System.Windows.Forms.Button(); - this.button_ZIPALIGN_BrowseInputFile = new System.Windows.Forms.Button(); - this.textBox_ZIPALIGN_InputFile = new System.Windows.Forms.TextBox(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabelStateImage = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabelStateText = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.ColumnImage = new System.Windows.Forms.DataGridViewImageColumn(); - this.ColumnTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.contextMenuStripLog = new System.Windows.Forms.ContextMenuStrip(this.components); - this.clearLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); - this.menuItemFile = new System.Windows.Forms.MenuItem(); - this.menuItemSettings = new System.Windows.Forms.MenuItem(); - this.menuItemExit = new System.Windows.Forms.MenuItem(); - this.menuItemHelp = new System.Windows.Forms.MenuItem(); - this.menuItemCheckUpdate = new System.Windows.Forms.MenuItem(); - this.menuItemAbout = new System.Windows.Forms.MenuItem(); - this.openFileDialogApk = new System.Windows.Forms.OpenFileDialog(); - this.folderBrowserDialogBuild = new System.Windows.Forms.FolderBrowserDialog(); - this.tabControlMain.SuspendLayout(); - this.tabPageDecode.SuspendLayout(); - this.groupBox_DECODE_Options.SuspendLayout(); - this.tableLayoutPanel_DECODE_Options.SuspendLayout(); - this.tableLayoutPanelDecodeOutputDir.SuspendLayout(); - this.tableLayoutPanelDecodeUseFramework.SuspendLayout(); - this.tabPageBuild.SuspendLayout(); - this.groupBox_BUILD_Options.SuspendLayout(); - this.tableLayoutPanel_BUILD_Options.SuspendLayout(); - this.tableLayoutPanelBuildOutputApk.SuspendLayout(); - this.tableLayoutPanelBuildUseFramework.SuspendLayout(); - this.tableLayoutPanelBuildUseAapt.SuspendLayout(); - this.tabPageInstallFramework.SuspendLayout(); - this.groupBox_IF_Options.SuspendLayout(); - this.tableLayoutPanel_IF_Options.SuspendLayout(); - this.tableLayoutPanel_IF_Tag.SuspendLayout(); - this.tableLayoutPanel_IF_FramePath.SuspendLayout(); - this.tabPageSign.SuspendLayout(); - this.groupBox_SIGN_Options.SuspendLayout(); - this.tableLayoutPanel_SIGN_Options.SuspendLayout(); - this.tableLayoutPanel_SIGN_PrivateKey.SuspendLayout(); - this.tableLayoutPanel_SIGN_PublicKey.SuspendLayout(); - this.tableLayoutPanel_SIGN_OutputFile.SuspendLayout(); - this.tabPageZipAlign.SuspendLayout(); - this.groupBox_ZIPALIGN_Options.SuspendLayout(); - this.tableLayoutPanel_ZIPALIGN_Options.SuspendLayout(); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_ZIPALIGN_AlignmentBytes)).BeginInit(); - this.tableLayoutPanel_ZIPALIGN_OutputFile.SuspendLayout(); - this.statusStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - this.contextMenuStripLog.SuspendLayout(); - this.SuspendLayout(); - // - // button_DECODE_BrowseInputAppPath - // - resources.ApplyResources(this.button_DECODE_BrowseInputAppPath, "button_DECODE_BrowseInputAppPath"); - this.button_DECODE_BrowseInputAppPath.Name = "button_DECODE_BrowseInputAppPath"; - this.button_DECODE_BrowseInputAppPath.UseVisualStyleBackColor = true; - this.button_DECODE_BrowseInputAppPath.Click += new System.EventHandler(this.button_DECODE_BrowseInputAppPath_Click); - // - // button_DECODE_Decode - // - resources.ApplyResources(this.button_DECODE_Decode, "button_DECODE_Decode"); - this.button_DECODE_Decode.Name = "button_DECODE_Decode"; - this.button_DECODE_Decode.UseVisualStyleBackColor = true; - this.button_DECODE_Decode.Click += new System.EventHandler(this.button_DECODE_Decode_Click); - // - // tabControlMain - // - resources.ApplyResources(this.tabControlMain, "tabControlMain"); - this.tabControlMain.Controls.Add(this.tabPageDecode); - this.tabControlMain.Controls.Add(this.tabPageBuild); - this.tabControlMain.Controls.Add(this.tabPageInstallFramework); - this.tabControlMain.Controls.Add(this.tabPageSign); - this.tabControlMain.Controls.Add(this.tabPageZipAlign); - this.tabControlMain.Name = "tabControlMain"; - this.tabControlMain.SelectedIndex = 0; - // - // tabPageDecode - // - this.tabPageDecode.BackColor = System.Drawing.SystemColors.Window; - this.tabPageDecode.Controls.Add(this.groupBox_DECODE_Options); - this.tabPageDecode.Controls.Add(this.textBox_DECODE_InputAppPath); - this.tabPageDecode.Controls.Add(this.button_DECODE_Decode); - this.tabPageDecode.Controls.Add(this.button_DECODE_BrowseInputAppPath); - resources.ApplyResources(this.tabPageDecode, "tabPageDecode"); - this.tabPageDecode.Name = "tabPageDecode"; - // - // groupBox_DECODE_Options - // - resources.ApplyResources(this.groupBox_DECODE_Options, "groupBox_DECODE_Options"); - this.groupBox_DECODE_Options.Controls.Add(this.tableLayoutPanel_DECODE_Options); - this.groupBox_DECODE_Options.Name = "groupBox_DECODE_Options"; - this.groupBox_DECODE_Options.TabStop = false; - // - // tableLayoutPanel_DECODE_Options - // - resources.ApplyResources(this.tableLayoutPanel_DECODE_Options, "tableLayoutPanel_DECODE_Options"); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.checkBox_DECODE_MatchOriginal, 0, 4); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.checkBox_DECODE_KeepBrokenRes, 0, 3); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.checkBox_DECODE_Force, 0, 2); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.checkBox_DECODE_NoRes, 0, 1); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.tableLayoutPanelDecodeOutputDir, 0, 6); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.tableLayoutPanelDecodeUseFramework, 0, 5); - this.tableLayoutPanel_DECODE_Options.Controls.Add(this.checkBox_DECODE_NoSrc, 0, 0); - this.tableLayoutPanel_DECODE_Options.Name = "tableLayoutPanel_DECODE_Options"; - // - // checkBox_DECODE_MatchOriginal - // - this.checkBox_DECODE_MatchOriginal.AutoEllipsis = true; - this.checkBox_DECODE_MatchOriginal.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_MatchOriginal; - this.checkBox_DECODE_MatchOriginal.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_MatchOriginal", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_MatchOriginal, "checkBox_DECODE_MatchOriginal"); - this.checkBox_DECODE_MatchOriginal.Name = "checkBox_DECODE_MatchOriginal"; - this.checkBox_DECODE_MatchOriginal.UseVisualStyleBackColor = true; - // - // checkBox_DECODE_KeepBrokenRes - // - this.checkBox_DECODE_KeepBrokenRes.AutoEllipsis = true; - this.checkBox_DECODE_KeepBrokenRes.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_KeepBrokenRes; - this.checkBox_DECODE_KeepBrokenRes.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_KeepBrokenRes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_KeepBrokenRes, "checkBox_DECODE_KeepBrokenRes"); - this.checkBox_DECODE_KeepBrokenRes.Name = "checkBox_DECODE_KeepBrokenRes"; - this.checkBox_DECODE_KeepBrokenRes.UseVisualStyleBackColor = true; - // - // checkBox_DECODE_Force - // - this.checkBox_DECODE_Force.AutoEllipsis = true; - this.checkBox_DECODE_Force.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_Force; - this.checkBox_DECODE_Force.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_Force", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_Force, "checkBox_DECODE_Force"); - this.checkBox_DECODE_Force.Name = "checkBox_DECODE_Force"; - this.checkBox_DECODE_Force.UseVisualStyleBackColor = true; - // - // checkBox_DECODE_NoRes - // - this.checkBox_DECODE_NoRes.AutoEllipsis = true; - this.checkBox_DECODE_NoRes.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_NoRes; - this.checkBox_DECODE_NoRes.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_NoRes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_NoRes, "checkBox_DECODE_NoRes"); - this.checkBox_DECODE_NoRes.Name = "checkBox_DECODE_NoRes"; - this.checkBox_DECODE_NoRes.UseVisualStyleBackColor = true; - // - // tableLayoutPanelDecodeOutputDir - // - resources.ApplyResources(this.tableLayoutPanelDecodeOutputDir, "tableLayoutPanelDecodeOutputDir"); - this.tableLayoutPanelDecodeOutputDir.Controls.Add(this.button_DECODE_BrowseOutputDirectory, 2, 0); - this.tableLayoutPanelDecodeOutputDir.Controls.Add(this.checkBox_DECODE_OutputDirectory, 0, 0); - this.tableLayoutPanelDecodeOutputDir.Controls.Add(this.textBox_DECODE_OutputDirectory, 1, 0); - this.tableLayoutPanelDecodeOutputDir.Name = "tableLayoutPanelDecodeOutputDir"; - // - // button_DECODE_BrowseOutputDirectory - // - this.button_DECODE_BrowseOutputDirectory.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseOutputDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_DECODE_BrowseOutputDirectory.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseOutputDir; - resources.ApplyResources(this.button_DECODE_BrowseOutputDirectory, "button_DECODE_BrowseOutputDirectory"); - this.button_DECODE_BrowseOutputDirectory.Name = "button_DECODE_BrowseOutputDirectory"; - this.button_DECODE_BrowseOutputDirectory.UseVisualStyleBackColor = true; - this.button_DECODE_BrowseOutputDirectory.Click += new System.EventHandler(this.button_DECODE_BrowseOutputDirectory_Click); - // - // checkBox_DECODE_OutputDirectory - // - this.checkBox_DECODE_OutputDirectory.AutoEllipsis = true; - this.checkBox_DECODE_OutputDirectory.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseOutputDir; - this.checkBox_DECODE_OutputDirectory.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseOutputDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_OutputDirectory, "checkBox_DECODE_OutputDirectory"); - this.checkBox_DECODE_OutputDirectory.Name = "checkBox_DECODE_OutputDirectory"; - this.checkBox_DECODE_OutputDirectory.UseVisualStyleBackColor = true; - // - // textBox_DECODE_OutputDirectory - // - this.textBox_DECODE_OutputDirectory.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseOutputDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_DECODE_OutputDirectory.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_OutputDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_DECODE_OutputDirectory, "textBox_DECODE_OutputDirectory"); - this.textBox_DECODE_OutputDirectory.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseOutputDir; - this.textBox_DECODE_OutputDirectory.Name = "textBox_DECODE_OutputDirectory"; - this.textBox_DECODE_OutputDirectory.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_OutputDir; - // - // tableLayoutPanelDecodeUseFramework - // - resources.ApplyResources(this.tableLayoutPanelDecodeUseFramework, "tableLayoutPanelDecodeUseFramework"); - this.tableLayoutPanelDecodeUseFramework.Controls.Add(this.textBox_DECODE_FrameDir, 0, 0); - this.tableLayoutPanelDecodeUseFramework.Controls.Add(this.checkBox_DECODE_UseFramework, 0, 0); - this.tableLayoutPanelDecodeUseFramework.Controls.Add(this.button_DECODE_BrowseFrameDir, 2, 0); - this.tableLayoutPanelDecodeUseFramework.Name = "tableLayoutPanelDecodeUseFramework"; - // - // textBox_DECODE_FrameDir - // - this.textBox_DECODE_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_DECODE_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_FrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_DECODE_FrameDir, "textBox_DECODE_FrameDir"); - this.textBox_DECODE_FrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseFramework; - this.textBox_DECODE_FrameDir.Name = "textBox_DECODE_FrameDir"; - this.textBox_DECODE_FrameDir.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_FrameDir; - // - // checkBox_DECODE_UseFramework - // - this.checkBox_DECODE_UseFramework.AutoEllipsis = true; - this.checkBox_DECODE_UseFramework.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseFramework; - this.checkBox_DECODE_UseFramework.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_UseFramework, "checkBox_DECODE_UseFramework"); - this.checkBox_DECODE_UseFramework.Name = "checkBox_DECODE_UseFramework"; - this.checkBox_DECODE_UseFramework.UseVisualStyleBackColor = true; - // - // button_DECODE_BrowseFrameDir - // - this.button_DECODE_BrowseFrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_DECODE_BrowseFrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_UseFramework; - resources.ApplyResources(this.button_DECODE_BrowseFrameDir, "button_DECODE_BrowseFrameDir"); - this.button_DECODE_BrowseFrameDir.Name = "button_DECODE_BrowseFrameDir"; - this.button_DECODE_BrowseFrameDir.UseVisualStyleBackColor = true; - this.button_DECODE_BrowseFrameDir.Click += new System.EventHandler(this.button_DECODE_BrowseFrameDir_Click); - // - // checkBox_DECODE_NoSrc - // - this.checkBox_DECODE_NoSrc.AutoEllipsis = true; - this.checkBox_DECODE_NoSrc.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_NoSrc; - this.checkBox_DECODE_NoSrc.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_NoSrc", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_DECODE_NoSrc, "checkBox_DECODE_NoSrc"); - this.checkBox_DECODE_NoSrc.Name = "checkBox_DECODE_NoSrc"; - this.checkBox_DECODE_NoSrc.UseVisualStyleBackColor = true; - // - // textBox_DECODE_InputAppPath - // - resources.ApplyResources(this.textBox_DECODE_InputAppPath, "textBox_DECODE_InputAppPath"); - this.textBox_DECODE_InputAppPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Decode_InputAppPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_DECODE_InputAppPath.Name = "textBox_DECODE_InputAppPath"; - this.textBox_DECODE_InputAppPath.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Decode_InputAppPath; - // - // tabPageBuild - // - this.tabPageBuild.Controls.Add(this.groupBox_BUILD_Options); - this.tabPageBuild.Controls.Add(this.button_BUILD_BrowseInputProjectDir); - this.tabPageBuild.Controls.Add(this.button_BUILD_Build); - this.tabPageBuild.Controls.Add(this.textBox_BUILD_InputProjectDir); - resources.ApplyResources(this.tabPageBuild, "tabPageBuild"); - this.tabPageBuild.Name = "tabPageBuild"; - this.tabPageBuild.UseVisualStyleBackColor = true; - // - // groupBox_BUILD_Options - // - resources.ApplyResources(this.groupBox_BUILD_Options, "groupBox_BUILD_Options"); - this.groupBox_BUILD_Options.Controls.Add(this.tableLayoutPanel_BUILD_Options); - this.groupBox_BUILD_Options.Name = "groupBox_BUILD_Options"; - this.groupBox_BUILD_Options.TabStop = false; - // - // tableLayoutPanel_BUILD_Options - // - resources.ApplyResources(this.tableLayoutPanel_BUILD_Options, "tableLayoutPanel_BUILD_Options"); - this.tableLayoutPanel_BUILD_Options.Controls.Add(this.tableLayoutPanelBuildOutputApk, 0, 4); - this.tableLayoutPanel_BUILD_Options.Controls.Add(this.checkBox_BUILD_CopyOriginal, 0, 1); - this.tableLayoutPanel_BUILD_Options.Controls.Add(this.tableLayoutPanelBuildUseFramework, 0, 3); - this.tableLayoutPanel_BUILD_Options.Controls.Add(this.tableLayoutPanelBuildUseAapt, 0, 2); - this.tableLayoutPanel_BUILD_Options.Controls.Add(this.checkBox_BUILD_ForceAll, 0, 0); - this.tableLayoutPanel_BUILD_Options.Name = "tableLayoutPanel_BUILD_Options"; - // - // tableLayoutPanelBuildOutputApk - // - resources.ApplyResources(this.tableLayoutPanelBuildOutputApk, "tableLayoutPanelBuildOutputApk"); - this.tableLayoutPanelBuildOutputApk.Controls.Add(this.button_BUILD_BrowseOutputAppPath, 2, 0); - this.tableLayoutPanelBuildOutputApk.Controls.Add(this.checkBox_BUILD_OutputAppPath, 0, 0); - this.tableLayoutPanelBuildOutputApk.Controls.Add(this.textBox_BUILD_OutputAppPath, 1, 0); - this.tableLayoutPanelBuildOutputApk.Name = "tableLayoutPanelBuildOutputApk"; - // - // button_BUILD_BrowseOutputAppPath - // - this.button_BUILD_BrowseOutputAppPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseOutputAppPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_BUILD_BrowseOutputAppPath.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseOutputAppPath; - resources.ApplyResources(this.button_BUILD_BrowseOutputAppPath, "button_BUILD_BrowseOutputAppPath"); - this.button_BUILD_BrowseOutputAppPath.Name = "button_BUILD_BrowseOutputAppPath"; - this.button_BUILD_BrowseOutputAppPath.UseVisualStyleBackColor = true; - this.button_BUILD_BrowseOutputAppPath.Click += new System.EventHandler(this.button_BUILD_BrowseOutputAppPath_Click); - // - // checkBox_BUILD_OutputAppPath - // - this.checkBox_BUILD_OutputAppPath.AutoEllipsis = true; - this.checkBox_BUILD_OutputAppPath.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseOutputAppPath; - this.checkBox_BUILD_OutputAppPath.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseOutputAppPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_BUILD_OutputAppPath, "checkBox_BUILD_OutputAppPath"); - this.checkBox_BUILD_OutputAppPath.Name = "checkBox_BUILD_OutputAppPath"; - this.checkBox_BUILD_OutputAppPath.UseVisualStyleBackColor = true; - // - // textBox_BUILD_OutputAppPath - // - this.textBox_BUILD_OutputAppPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_OutputAppPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_BUILD_OutputAppPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseOutputAppPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_BUILD_OutputAppPath, "textBox_BUILD_OutputAppPath"); - this.textBox_BUILD_OutputAppPath.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseOutputAppPath; - this.textBox_BUILD_OutputAppPath.Name = "textBox_BUILD_OutputAppPath"; - this.textBox_BUILD_OutputAppPath.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_OutputAppPath; - // - // checkBox_BUILD_CopyOriginal - // - this.checkBox_BUILD_CopyOriginal.AutoEllipsis = true; - this.checkBox_BUILD_CopyOriginal.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_CopyOriginal; - this.checkBox_BUILD_CopyOriginal.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_CopyOriginal", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_BUILD_CopyOriginal, "checkBox_BUILD_CopyOriginal"); - this.checkBox_BUILD_CopyOriginal.Name = "checkBox_BUILD_CopyOriginal"; - this.checkBox_BUILD_CopyOriginal.UseVisualStyleBackColor = true; - // - // tableLayoutPanelBuildUseFramework - // - resources.ApplyResources(this.tableLayoutPanelBuildUseFramework, "tableLayoutPanelBuildUseFramework"); - this.tableLayoutPanelBuildUseFramework.Controls.Add(this.button_BUILD_BrowseFrameDir, 2, 0); - this.tableLayoutPanelBuildUseFramework.Controls.Add(this.checkBox_BUILD_UseFramework, 0, 0); - this.tableLayoutPanelBuildUseFramework.Controls.Add(this.textBox_BUILD_FrameDir, 1, 0); - this.tableLayoutPanelBuildUseFramework.Name = "tableLayoutPanelBuildUseFramework"; - // - // button_BUILD_BrowseFrameDir - // - this.button_BUILD_BrowseFrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_BUILD_BrowseFrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseFramework; - resources.ApplyResources(this.button_BUILD_BrowseFrameDir, "button_BUILD_BrowseFrameDir"); - this.button_BUILD_BrowseFrameDir.Name = "button_BUILD_BrowseFrameDir"; - this.button_BUILD_BrowseFrameDir.UseVisualStyleBackColor = true; - this.button_BUILD_BrowseFrameDir.Click += new System.EventHandler(this.button_BUILD_BrowseFrameDir_Click); - // - // checkBox_BUILD_UseFramework - // - this.checkBox_BUILD_UseFramework.AutoEllipsis = true; - this.checkBox_BUILD_UseFramework.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseFramework; - this.checkBox_BUILD_UseFramework.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_BUILD_UseFramework, "checkBox_BUILD_UseFramework"); - this.checkBox_BUILD_UseFramework.Name = "checkBox_BUILD_UseFramework"; - this.checkBox_BUILD_UseFramework.UseVisualStyleBackColor = true; - // - // textBox_BUILD_FrameDir - // - this.textBox_BUILD_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_FrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_BUILD_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseFramework", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_BUILD_FrameDir, "textBox_BUILD_FrameDir"); - this.textBox_BUILD_FrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseFramework; - this.textBox_BUILD_FrameDir.Name = "textBox_BUILD_FrameDir"; - this.textBox_BUILD_FrameDir.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_FrameDir; - // - // tableLayoutPanelBuildUseAapt - // - resources.ApplyResources(this.tableLayoutPanelBuildUseAapt, "tableLayoutPanelBuildUseAapt"); - this.tableLayoutPanelBuildUseAapt.Controls.Add(this.textBox_BUILD_AaptPath, 0, 0); - this.tableLayoutPanelBuildUseAapt.Controls.Add(this.checkBox_BUILD_UseAapt, 0, 0); - this.tableLayoutPanelBuildUseAapt.Controls.Add(this.button_BUILD_BrowseAaptPath, 2, 0); - this.tableLayoutPanelBuildUseAapt.Name = "tableLayoutPanelBuildUseAapt"; - // - // textBox_BUILD_AaptPath - // - this.textBox_BUILD_AaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_AaptPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_BUILD_AaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_BUILD_AaptPath, "textBox_BUILD_AaptPath"); - this.textBox_BUILD_AaptPath.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseAapt; - this.textBox_BUILD_AaptPath.Name = "textBox_BUILD_AaptPath"; - this.textBox_BUILD_AaptPath.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_AaptPath; - // - // checkBox_BUILD_UseAapt - // - this.checkBox_BUILD_UseAapt.AutoEllipsis = true; - this.checkBox_BUILD_UseAapt.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseAapt; - this.checkBox_BUILD_UseAapt.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_BUILD_UseAapt, "checkBox_BUILD_UseAapt"); - this.checkBox_BUILD_UseAapt.Name = "checkBox_BUILD_UseAapt"; - this.checkBox_BUILD_UseAapt.UseVisualStyleBackColor = true; - // - // button_BUILD_BrowseAaptPath - // - this.button_BUILD_BrowseAaptPath.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_UseAapt", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_BUILD_BrowseAaptPath.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_UseAapt; - resources.ApplyResources(this.button_BUILD_BrowseAaptPath, "button_BUILD_BrowseAaptPath"); - this.button_BUILD_BrowseAaptPath.Name = "button_BUILD_BrowseAaptPath"; - this.button_BUILD_BrowseAaptPath.UseVisualStyleBackColor = true; - this.button_BUILD_BrowseAaptPath.Click += new System.EventHandler(this.button_BUILD_BrowseAaptPath_Click); - // - // checkBox_BUILD_ForceAll - // - this.checkBox_BUILD_ForceAll.AutoEllipsis = true; - this.checkBox_BUILD_ForceAll.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_ForceAll; - this.checkBox_BUILD_ForceAll.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_ForceAll", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_BUILD_ForceAll, "checkBox_BUILD_ForceAll"); - this.checkBox_BUILD_ForceAll.Name = "checkBox_BUILD_ForceAll"; - this.checkBox_BUILD_ForceAll.UseVisualStyleBackColor = true; - // - // button_BUILD_BrowseInputProjectDir - // - resources.ApplyResources(this.button_BUILD_BrowseInputProjectDir, "button_BUILD_BrowseInputProjectDir"); - this.button_BUILD_BrowseInputProjectDir.Name = "button_BUILD_BrowseInputProjectDir"; - this.button_BUILD_BrowseInputProjectDir.UseVisualStyleBackColor = true; - this.button_BUILD_BrowseInputProjectDir.Click += new System.EventHandler(this.button_BUILD_BrowseInputProjectDir_Click); - // - // button_BUILD_Build - // - resources.ApplyResources(this.button_BUILD_Build, "button_BUILD_Build"); - this.button_BUILD_Build.Name = "button_BUILD_Build"; - this.button_BUILD_Build.UseVisualStyleBackColor = true; - this.button_BUILD_Build.Click += new System.EventHandler(this.button_BUILD_Build_Click); - // - // textBox_BUILD_InputProjectDir - // - resources.ApplyResources(this.textBox_BUILD_InputProjectDir, "textBox_BUILD_InputProjectDir"); - this.textBox_BUILD_InputProjectDir.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Build_InputDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_BUILD_InputProjectDir.Name = "textBox_BUILD_InputProjectDir"; - this.textBox_BUILD_InputProjectDir.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Build_InputDir; - // - // tabPageInstallFramework - // - this.tabPageInstallFramework.Controls.Add(this.groupBox_IF_Options); - this.tabPageInstallFramework.Controls.Add(this.button_IF_InstallFramework); - this.tabPageInstallFramework.Controls.Add(this.button_IF_BrowseInputFramePath); - this.tabPageInstallFramework.Controls.Add(this.textBox_IF_InputFramePath); - resources.ApplyResources(this.tabPageInstallFramework, "tabPageInstallFramework"); - this.tabPageInstallFramework.Name = "tabPageInstallFramework"; - this.tabPageInstallFramework.UseVisualStyleBackColor = true; - // - // groupBox_IF_Options - // - resources.ApplyResources(this.groupBox_IF_Options, "groupBox_IF_Options"); - this.groupBox_IF_Options.Controls.Add(this.tableLayoutPanel_IF_Options); - this.groupBox_IF_Options.Name = "groupBox_IF_Options"; - this.groupBox_IF_Options.TabStop = false; - // - // tableLayoutPanel_IF_Options - // - resources.ApplyResources(this.tableLayoutPanel_IF_Options, "tableLayoutPanel_IF_Options"); - this.tableLayoutPanel_IF_Options.Controls.Add(this.tableLayoutPanel_IF_Tag, 0, 1); - this.tableLayoutPanel_IF_Options.Controls.Add(this.tableLayoutPanel_IF_FramePath, 0, 0); - this.tableLayoutPanel_IF_Options.Name = "tableLayoutPanel_IF_Options"; - // - // tableLayoutPanel_IF_Tag - // - resources.ApplyResources(this.tableLayoutPanel_IF_Tag, "tableLayoutPanel_IF_Tag"); - this.tableLayoutPanel_IF_Tag.Controls.Add(this.checkBox_IF_Tag, 0, 0); - this.tableLayoutPanel_IF_Tag.Controls.Add(this.textBox_IF_Tag, 1, 0); - this.tableLayoutPanel_IF_Tag.Name = "tableLayoutPanel_IF_Tag"; - // - // checkBox_IF_Tag - // - this.checkBox_IF_Tag.AutoEllipsis = true; - this.checkBox_IF_Tag.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_UseTag; - this.checkBox_IF_Tag.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_UseTag", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_IF_Tag, "checkBox_IF_Tag"); - this.checkBox_IF_Tag.Name = "checkBox_IF_Tag"; - this.checkBox_IF_Tag.UseVisualStyleBackColor = true; - // - // textBox_IF_Tag - // - this.textBox_IF_Tag.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_Tag", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_IF_Tag.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_UseTag", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_IF_Tag, "textBox_IF_Tag"); - this.textBox_IF_Tag.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_UseTag; - this.textBox_IF_Tag.Name = "textBox_IF_Tag"; - this.textBox_IF_Tag.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_Tag; - // - // tableLayoutPanel_IF_FramePath - // - resources.ApplyResources(this.tableLayoutPanel_IF_FramePath, "tableLayoutPanel_IF_FramePath"); - this.tableLayoutPanel_IF_FramePath.Controls.Add(this.textBox_IF_FrameDir, 0, 0); - this.tableLayoutPanel_IF_FramePath.Controls.Add(this.checkBox_IF_FramePath, 0, 0); - this.tableLayoutPanel_IF_FramePath.Controls.Add(this.button_IF_BrowseFrameDir, 2, 0); - this.tableLayoutPanel_IF_FramePath.Name = "tableLayoutPanel_IF_FramePath"; - // - // textBox_IF_FrameDir - // - this.textBox_IF_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_UseFrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_IF_FrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_FrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_IF_FrameDir, "textBox_IF_FrameDir"); - this.textBox_IF_FrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_UseFrameDir; - this.textBox_IF_FrameDir.Name = "textBox_IF_FrameDir"; - this.textBox_IF_FrameDir.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_FrameDir; - // - // checkBox_IF_FramePath - // - this.checkBox_IF_FramePath.AutoEllipsis = true; - this.checkBox_IF_FramePath.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_UseFrameDir; - this.checkBox_IF_FramePath.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_UseFrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_IF_FramePath, "checkBox_IF_FramePath"); - this.checkBox_IF_FramePath.Name = "checkBox_IF_FramePath"; - this.checkBox_IF_FramePath.UseVisualStyleBackColor = true; - // - // button_IF_BrowseFrameDir - // - this.button_IF_BrowseFrameDir.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_UseFrameDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.button_IF_BrowseFrameDir.Enabled = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_UseFrameDir; - resources.ApplyResources(this.button_IF_BrowseFrameDir, "button_IF_BrowseFrameDir"); - this.button_IF_BrowseFrameDir.Name = "button_IF_BrowseFrameDir"; - this.button_IF_BrowseFrameDir.UseVisualStyleBackColor = true; - this.button_IF_BrowseFrameDir.Click += new System.EventHandler(this.button_IF_BrowseFrameDir_Click); - // - // button_IF_InstallFramework - // - resources.ApplyResources(this.button_IF_InstallFramework, "button_IF_InstallFramework"); - this.button_IF_InstallFramework.Name = "button_IF_InstallFramework"; - this.button_IF_InstallFramework.UseVisualStyleBackColor = true; - this.button_IF_InstallFramework.Click += new System.EventHandler(this.button_IF_InstallFramework_Click); - // - // button_IF_BrowseInputFramePath - // - resources.ApplyResources(this.button_IF_BrowseInputFramePath, "button_IF_BrowseInputFramePath"); - this.button_IF_BrowseInputFramePath.Name = "button_IF_BrowseInputFramePath"; - this.button_IF_BrowseInputFramePath.UseVisualStyleBackColor = true; - this.button_IF_BrowseInputFramePath.Click += new System.EventHandler(this.button_IF_BrowseInputFramePath_Click); - // - // textBox_IF_InputFramePath - // - resources.ApplyResources(this.textBox_IF_InputFramePath, "textBox_IF_InputFramePath"); - this.textBox_IF_InputFramePath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_InstallFramework_InputFramePath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_IF_InputFramePath.Name = "textBox_IF_InputFramePath"; - this.textBox_IF_InputFramePath.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_InstallFramework_InputFramePath; - // - // tabPageSign - // - this.tabPageSign.BackColor = System.Drawing.SystemColors.Window; - this.tabPageSign.Controls.Add(this.groupBox_SIGN_Options); - this.tabPageSign.Controls.Add(this.textBox_SIGN_InputFile); - this.tabPageSign.Controls.Add(this.button_SIGN_BrowseInputFile); - this.tabPageSign.Controls.Add(this.button_SIGN_Sign); - resources.ApplyResources(this.tabPageSign, "tabPageSign"); - this.tabPageSign.Name = "tabPageSign"; - // - // groupBox_SIGN_Options - // - resources.ApplyResources(this.groupBox_SIGN_Options, "groupBox_SIGN_Options"); - this.groupBox_SIGN_Options.Controls.Add(this.tableLayoutPanel_SIGN_Options); - this.groupBox_SIGN_Options.Name = "groupBox_SIGN_Options"; - this.groupBox_SIGN_Options.TabStop = false; - // - // tableLayoutPanel_SIGN_Options - // - resources.ApplyResources(this.tableLayoutPanel_SIGN_Options, "tableLayoutPanel_SIGN_Options"); - this.tableLayoutPanel_SIGN_Options.Controls.Add(this.tableLayoutPanel_SIGN_PrivateKey, 0, 1); - this.tableLayoutPanel_SIGN_Options.Controls.Add(this.tableLayoutPanel_SIGN_PublicKey, 0, 0); - this.tableLayoutPanel_SIGN_Options.Controls.Add(this.tableLayoutPanel_SIGN_OutputFile, 0, 2); - this.tableLayoutPanel_SIGN_Options.Name = "tableLayoutPanel_SIGN_Options"; - // - // tableLayoutPanel_SIGN_PrivateKey - // - resources.ApplyResources(this.tableLayoutPanel_SIGN_PrivateKey, "tableLayoutPanel_SIGN_PrivateKey"); - this.tableLayoutPanel_SIGN_PrivateKey.Controls.Add(this.label_SIGN_PrivateKey, 0, 0); - this.tableLayoutPanel_SIGN_PrivateKey.Controls.Add(this.button_SIGN_BrowsePrivateKey, 2, 0); - this.tableLayoutPanel_SIGN_PrivateKey.Controls.Add(this.textBox_SIGN_PrivateKey, 1, 0); - this.tableLayoutPanel_SIGN_PrivateKey.Name = "tableLayoutPanel_SIGN_PrivateKey"; - // - // label_SIGN_PrivateKey - // - resources.ApplyResources(this.label_SIGN_PrivateKey, "label_SIGN_PrivateKey"); - this.label_SIGN_PrivateKey.Name = "label_SIGN_PrivateKey"; - // - // button_SIGN_BrowsePrivateKey - // - resources.ApplyResources(this.button_SIGN_BrowsePrivateKey, "button_SIGN_BrowsePrivateKey"); - this.button_SIGN_BrowsePrivateKey.Name = "button_SIGN_BrowsePrivateKey"; - this.button_SIGN_BrowsePrivateKey.UseVisualStyleBackColor = true; - this.button_SIGN_BrowsePrivateKey.Click += new System.EventHandler(this.button_SIGN_BrowsePrivateKey_Click); - // - // textBox_SIGN_PrivateKey - // - this.textBox_SIGN_PrivateKey.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_SIGN_PrivateKey", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_SIGN_PrivateKey, "textBox_SIGN_PrivateKey"); - this.textBox_SIGN_PrivateKey.Name = "textBox_SIGN_PrivateKey"; - this.textBox_SIGN_PrivateKey.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_SIGN_PrivateKey; - // - // tableLayoutPanel_SIGN_PublicKey - // - resources.ApplyResources(this.tableLayoutPanel_SIGN_PublicKey, "tableLayoutPanel_SIGN_PublicKey"); - this.tableLayoutPanel_SIGN_PublicKey.Controls.Add(this.label_SIGN_PublicKey, 0, 0); - this.tableLayoutPanel_SIGN_PublicKey.Controls.Add(this.button_SIGN_BrowsePublicKey, 2, 0); - this.tableLayoutPanel_SIGN_PublicKey.Controls.Add(this.textBox_SIGN_PublicKey, 1, 0); - this.tableLayoutPanel_SIGN_PublicKey.Name = "tableLayoutPanel_SIGN_PublicKey"; - // - // label_SIGN_PublicKey - // - resources.ApplyResources(this.label_SIGN_PublicKey, "label_SIGN_PublicKey"); - this.label_SIGN_PublicKey.Name = "label_SIGN_PublicKey"; - // - // button_SIGN_BrowsePublicKey - // - resources.ApplyResources(this.button_SIGN_BrowsePublicKey, "button_SIGN_BrowsePublicKey"); - this.button_SIGN_BrowsePublicKey.Name = "button_SIGN_BrowsePublicKey"; - this.button_SIGN_BrowsePublicKey.UseVisualStyleBackColor = true; - this.button_SIGN_BrowsePublicKey.Click += new System.EventHandler(this.button_SIGN_BrowsePublicKey_Click); - // - // textBox_SIGN_PublicKey - // - this.textBox_SIGN_PublicKey.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_SIGN_PublicKey", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_SIGN_PublicKey, "textBox_SIGN_PublicKey"); - this.textBox_SIGN_PublicKey.Name = "textBox_SIGN_PublicKey"; - this.textBox_SIGN_PublicKey.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_SIGN_PublicKey; - // - // tableLayoutPanel_SIGN_OutputFile - // - resources.ApplyResources(this.tableLayoutPanel_SIGN_OutputFile, "tableLayoutPanel_SIGN_OutputFile"); - this.tableLayoutPanel_SIGN_OutputFile.Controls.Add(this.label_SIGN_OutputFile, 0, 0); - this.tableLayoutPanel_SIGN_OutputFile.Controls.Add(this.button_SIGN_BrowseOutputFile, 2, 0); - this.tableLayoutPanel_SIGN_OutputFile.Controls.Add(this.textBox_SIGN_OutputFile, 1, 0); - this.tableLayoutPanel_SIGN_OutputFile.Name = "tableLayoutPanel_SIGN_OutputFile"; - // - // label_SIGN_OutputFile - // - resources.ApplyResources(this.label_SIGN_OutputFile, "label_SIGN_OutputFile"); - this.label_SIGN_OutputFile.Name = "label_SIGN_OutputFile"; - // - // button_SIGN_BrowseOutputFile - // - resources.ApplyResources(this.button_SIGN_BrowseOutputFile, "button_SIGN_BrowseOutputFile"); - this.button_SIGN_BrowseOutputFile.Name = "button_SIGN_BrowseOutputFile"; - this.button_SIGN_BrowseOutputFile.UseVisualStyleBackColor = true; - this.button_SIGN_BrowseOutputFile.Click += new System.EventHandler(this.button_SIGN_BrowseOutputFile_Click); - // - // textBox_SIGN_OutputFile - // - this.textBox_SIGN_OutputFile.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_SIGN_OutputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_SIGN_OutputFile, "textBox_SIGN_OutputFile"); - this.textBox_SIGN_OutputFile.Name = "textBox_SIGN_OutputFile"; - this.textBox_SIGN_OutputFile.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_SIGN_OutputFile; - // - // textBox_SIGN_InputFile - // - resources.ApplyResources(this.textBox_SIGN_InputFile, "textBox_SIGN_InputFile"); - this.textBox_SIGN_InputFile.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_SIGN_InputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_SIGN_InputFile.Name = "textBox_SIGN_InputFile"; - this.textBox_SIGN_InputFile.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_SIGN_InputFile; - // - // button_SIGN_BrowseInputFile - // - resources.ApplyResources(this.button_SIGN_BrowseInputFile, "button_SIGN_BrowseInputFile"); - this.button_SIGN_BrowseInputFile.Name = "button_SIGN_BrowseInputFile"; - this.button_SIGN_BrowseInputFile.UseVisualStyleBackColor = true; - this.button_SIGN_BrowseInputFile.Click += new System.EventHandler(this.button_SIGN_BrowseInputFile_Click); - // - // button_SIGN_Sign - // - resources.ApplyResources(this.button_SIGN_Sign, "button_SIGN_Sign"); - this.button_SIGN_Sign.Name = "button_SIGN_Sign"; - this.button_SIGN_Sign.UseVisualStyleBackColor = true; - this.button_SIGN_Sign.Click += new System.EventHandler(this.button_SIGN_Sign_Click); - // - // tabPageZipAlign - // - this.tabPageZipAlign.Controls.Add(this.groupBox_ZIPALIGN_Options); - this.tabPageZipAlign.Controls.Add(this.button_ZIPALIGN_Align); - this.tabPageZipAlign.Controls.Add(this.button_ZIPALIGN_BrowseInputFile); - this.tabPageZipAlign.Controls.Add(this.textBox_ZIPALIGN_InputFile); - resources.ApplyResources(this.tabPageZipAlign, "tabPageZipAlign"); - this.tabPageZipAlign.Name = "tabPageZipAlign"; - this.tabPageZipAlign.UseVisualStyleBackColor = true; - // - // groupBox_ZIPALIGN_Options - // - resources.ApplyResources(this.groupBox_ZIPALIGN_Options, "groupBox_ZIPALIGN_Options"); - this.groupBox_ZIPALIGN_Options.Controls.Add(this.tableLayoutPanel_ZIPALIGN_Options); - this.groupBox_ZIPALIGN_Options.Name = "groupBox_ZIPALIGN_Options"; - this.groupBox_ZIPALIGN_Options.TabStop = false; - // - // tableLayoutPanel_ZIPALIGN_Options - // - resources.ApplyResources(this.tableLayoutPanel_ZIPALIGN_Options, "tableLayoutPanel_ZIPALIGN_Options"); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.checkBox_ZIPALIGN_Recompress, 0, 3); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.tableLayoutPanel_ZIPALIGN_AlignmentBytes, 0, 0); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.checkBox_ZIPALIGN_VerboseOutput, 0, 2); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.checkBox_ZIPALIGN_CheckAlignment, 0, 1); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.tableLayoutPanel_ZIPALIGN_OutputFile, 0, 5); - this.tableLayoutPanel_ZIPALIGN_Options.Controls.Add(this.checkBox_ZIPALIGN_OverwriteOutputFile, 0, 4); - this.tableLayoutPanel_ZIPALIGN_Options.Name = "tableLayoutPanel_ZIPALIGN_Options"; - // - // checkBox_ZIPALIGN_Recompress - // - this.checkBox_ZIPALIGN_Recompress.AutoEllipsis = true; - this.checkBox_ZIPALIGN_Recompress.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_Recompress; - this.checkBox_ZIPALIGN_Recompress.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_Recompress", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_ZIPALIGN_Recompress, "checkBox_ZIPALIGN_Recompress"); - this.checkBox_ZIPALIGN_Recompress.Name = "checkBox_ZIPALIGN_Recompress"; - this.checkBox_ZIPALIGN_Recompress.UseVisualStyleBackColor = true; - // - // tableLayoutPanel_ZIPALIGN_AlignmentBytes - // - resources.ApplyResources(this.tableLayoutPanel_ZIPALIGN_AlignmentBytes, "tableLayoutPanel_ZIPALIGN_AlignmentBytes"); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.Controls.Add(this.label_ZIPALIGN_AlignmentBytes, 0, 0); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.Controls.Add(this.numericUpDown_ZIPALIGN_AlignmentBytes, 1, 0); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.Name = "tableLayoutPanel_ZIPALIGN_AlignmentBytes"; - // - // label_ZIPALIGN_AlignmentBytes - // - resources.ApplyResources(this.label_ZIPALIGN_AlignmentBytes, "label_ZIPALIGN_AlignmentBytes"); - this.label_ZIPALIGN_AlignmentBytes.Name = "label_ZIPALIGN_AlignmentBytes"; - // - // numericUpDown_ZIPALIGN_AlignmentBytes - // - this.numericUpDown_ZIPALIGN_AlignmentBytes.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_AlignmentInBytes", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.numericUpDown_ZIPALIGN_AlignmentBytes, "numericUpDown_ZIPALIGN_AlignmentBytes"); - this.numericUpDown_ZIPALIGN_AlignmentBytes.Maximum = new decimal(new int[] { - 32, - 0, - 0, - 0}); - this.numericUpDown_ZIPALIGN_AlignmentBytes.Name = "numericUpDown_ZIPALIGN_AlignmentBytes"; - this.numericUpDown_ZIPALIGN_AlignmentBytes.Value = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_AlignmentInBytes; - // - // checkBox_ZIPALIGN_VerboseOutput - // - this.checkBox_ZIPALIGN_VerboseOutput.AutoEllipsis = true; - this.checkBox_ZIPALIGN_VerboseOutput.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_Verbose; - this.checkBox_ZIPALIGN_VerboseOutput.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_Verbose", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_ZIPALIGN_VerboseOutput, "checkBox_ZIPALIGN_VerboseOutput"); - this.checkBox_ZIPALIGN_VerboseOutput.Name = "checkBox_ZIPALIGN_VerboseOutput"; - this.checkBox_ZIPALIGN_VerboseOutput.UseVisualStyleBackColor = true; - // - // checkBox_ZIPALIGN_CheckAlignment - // - this.checkBox_ZIPALIGN_CheckAlignment.AutoEllipsis = true; - this.checkBox_ZIPALIGN_CheckAlignment.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_CheckOnly; - this.checkBox_ZIPALIGN_CheckAlignment.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_CheckOnly", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_ZIPALIGN_CheckAlignment, "checkBox_ZIPALIGN_CheckAlignment"); - this.checkBox_ZIPALIGN_CheckAlignment.Name = "checkBox_ZIPALIGN_CheckAlignment"; - this.checkBox_ZIPALIGN_CheckAlignment.UseVisualStyleBackColor = true; - this.checkBox_ZIPALIGN_CheckAlignment.CheckedChanged += new System.EventHandler(this.checkBox_ZIPALIGN_CheckAlignment_CheckedChanged); - // - // tableLayoutPanel_ZIPALIGN_OutputFile - // - resources.ApplyResources(this.tableLayoutPanel_ZIPALIGN_OutputFile, "tableLayoutPanel_ZIPALIGN_OutputFile"); - this.tableLayoutPanel_ZIPALIGN_OutputFile.Controls.Add(this.label_ZIPALIGN_OutputFile, 0, 0); - this.tableLayoutPanel_ZIPALIGN_OutputFile.Controls.Add(this.button_ZIPALIGN_BrowseOutputFile, 2, 0); - this.tableLayoutPanel_ZIPALIGN_OutputFile.Controls.Add(this.textBox_ZIPALIGN_OutputFile, 1, 0); - this.tableLayoutPanel_ZIPALIGN_OutputFile.Name = "tableLayoutPanel_ZIPALIGN_OutputFile"; - // - // label_ZIPALIGN_OutputFile - // - resources.ApplyResources(this.label_ZIPALIGN_OutputFile, "label_ZIPALIGN_OutputFile"); - this.label_ZIPALIGN_OutputFile.Name = "label_ZIPALIGN_OutputFile"; - // - // button_ZIPALIGN_BrowseOutputFile - // - resources.ApplyResources(this.button_ZIPALIGN_BrowseOutputFile, "button_ZIPALIGN_BrowseOutputFile"); - this.button_ZIPALIGN_BrowseOutputFile.Name = "button_ZIPALIGN_BrowseOutputFile"; - this.button_ZIPALIGN_BrowseOutputFile.UseVisualStyleBackColor = true; - this.button_ZIPALIGN_BrowseOutputFile.Click += new System.EventHandler(this.button_ZIPALIGN_BrowseOutputFile_Click); - // - // textBox_ZIPALIGN_OutputFile - // - this.textBox_ZIPALIGN_OutputFile.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_OutputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.textBox_ZIPALIGN_OutputFile, "textBox_ZIPALIGN_OutputFile"); - this.textBox_ZIPALIGN_OutputFile.Name = "textBox_ZIPALIGN_OutputFile"; - this.textBox_ZIPALIGN_OutputFile.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_OutputFile; - // - // checkBox_ZIPALIGN_OverwriteOutputFile - // - this.checkBox_ZIPALIGN_OverwriteOutputFile.AutoEllipsis = true; - this.checkBox_ZIPALIGN_OverwriteOutputFile.Checked = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_OverwriteOutputFile; - this.checkBox_ZIPALIGN_OverwriteOutputFile.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_OverwriteOutputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - resources.ApplyResources(this.checkBox_ZIPALIGN_OverwriteOutputFile, "checkBox_ZIPALIGN_OverwriteOutputFile"); - this.checkBox_ZIPALIGN_OverwriteOutputFile.Name = "checkBox_ZIPALIGN_OverwriteOutputFile"; - this.checkBox_ZIPALIGN_OverwriteOutputFile.UseVisualStyleBackColor = true; - // - // button_ZIPALIGN_Align - // - resources.ApplyResources(this.button_ZIPALIGN_Align, "button_ZIPALIGN_Align"); - this.button_ZIPALIGN_Align.Name = "button_ZIPALIGN_Align"; - this.button_ZIPALIGN_Align.UseVisualStyleBackColor = true; - this.button_ZIPALIGN_Align.Click += new System.EventHandler(this.button_ZIPALIGN_Align_Click); - // - // button_ZIPALIGN_BrowseInputFile - // - resources.ApplyResources(this.button_ZIPALIGN_BrowseInputFile, "button_ZIPALIGN_BrowseInputFile"); - this.button_ZIPALIGN_BrowseInputFile.Name = "button_ZIPALIGN_BrowseInputFile"; - this.button_ZIPALIGN_BrowseInputFile.UseVisualStyleBackColor = true; - this.button_ZIPALIGN_BrowseInputFile.Click += new System.EventHandler(this.button_ZIPALIGN_BrowseInputFile_Click); - // - // textBox_ZIPALIGN_InputFile - // - resources.ApplyResources(this.textBox_ZIPALIGN_InputFile, "textBox_ZIPALIGN_InputFile"); - this.textBox_ZIPALIGN_InputFile.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::APKToolGUI.Properties.Settings.Default, "MAIN_Zipalign_InputFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.textBox_ZIPALIGN_InputFile.Name = "textBox_ZIPALIGN_InputFile"; - this.textBox_ZIPALIGN_InputFile.Text = global::APKToolGUI.Properties.Settings.Default.MAIN_Zipalign_InputFile; - // - // statusStrip1 - // - this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabelStateImage, - this.toolStripStatusLabelStateText, - this.toolStripProgressBar1}); - resources.ApplyResources(this.statusStrip1, "statusStrip1"); - this.statusStrip1.Name = "statusStrip1"; - // - // toolStripStatusLabelStateImage - // - this.toolStripStatusLabelStateImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripStatusLabelStateImage.Name = "toolStripStatusLabelStateImage"; - resources.ApplyResources(this.toolStripStatusLabelStateImage, "toolStripStatusLabelStateImage"); - // - // toolStripStatusLabelStateText - // - this.toolStripStatusLabelStateText.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripStatusLabelStateText.Image = global::APKToolGUI.Properties.Resources.waiting; - resources.ApplyResources(this.toolStripStatusLabelStateText, "toolStripStatusLabelStateText"); - this.toolStripStatusLabelStateText.Name = "toolStripStatusLabelStateText"; - this.toolStripStatusLabelStateText.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.toolStripStatusLabelStateText.Spring = true; - // - // toolStripProgressBar1 - // - this.toolStripProgressBar1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - resources.ApplyResources(this.toolStripProgressBar1, "toolStripProgressBar1"); - this.toolStripProgressBar1.MarqueeAnimationSpeed = 30; - this.toolStripProgressBar1.Name = "toolStripProgressBar1"; - this.toolStripProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; - // - // dataGridView1 - // - this.dataGridView1.AllowUserToAddRows = false; - this.dataGridView1.AllowUserToDeleteRows = false; - this.dataGridView1.AllowUserToResizeRows = false; - resources.ApplyResources(this.dataGridView1, "dataGridView1"); - this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Window; - this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText; - this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColumnImage, - this.ColumnTime, - this.ColumnMessage}); - this.dataGridView1.ContextMenuStrip = this.contextMenuStripLog; - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.ReadOnly = true; - this.dataGridView1.RowHeadersVisible = false; - this.dataGridView1.RowTemplate.Height = 19; - this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView1.ShowEditingIcon = false; - // - // ColumnImage - // - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.NullValue = null; - this.ColumnImage.DefaultCellStyle = dataGridViewCellStyle2; - this.ColumnImage.Frozen = true; - resources.ApplyResources(this.ColumnImage, "ColumnImage"); - this.ColumnImage.Name = "ColumnImage"; - this.ColumnImage.ReadOnly = true; - this.ColumnImage.Resizable = System.Windows.Forms.DataGridViewTriState.False; - // - // ColumnTime - // - this.ColumnTime.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColumnTime.Frozen = true; - resources.ApplyResources(this.ColumnTime, "ColumnTime"); - this.ColumnTime.Name = "ColumnTime"; - this.ColumnTime.ReadOnly = true; - // - // ColumnMessage - // - this.ColumnMessage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - resources.ApplyResources(this.ColumnMessage, "ColumnMessage"); - this.ColumnMessage.Name = "ColumnMessage"; - this.ColumnMessage.ReadOnly = true; - // - // contextMenuStripLog - // - this.contextMenuStripLog.ImageScalingSize = new System.Drawing.Size(20, 20); - this.contextMenuStripLog.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.clearLogToolStripMenuItem}); - this.contextMenuStripLog.Name = "contextMenuStripLog"; - resources.ApplyResources(this.contextMenuStripLog, "contextMenuStripLog"); - // - // clearLogToolStripMenuItem - // - this.clearLogToolStripMenuItem.Name = "clearLogToolStripMenuItem"; - resources.ApplyResources(this.clearLogToolStripMenuItem, "clearLogToolStripMenuItem"); - this.clearLogToolStripMenuItem.Click += new System.EventHandler(this.clearLogToolStripMenuItem_Click); - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItemFile, - this.menuItemHelp}); - // - // menuItemFile - // - this.menuItemFile.Index = 0; - this.menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItemSettings, - this.menuItemExit}); - resources.ApplyResources(this.menuItemFile, "menuItemFile"); - // - // menuItemSettings - // - this.menuItemSettings.Index = 0; - resources.ApplyResources(this.menuItemSettings, "menuItemSettings"); - this.menuItemSettings.Click += new System.EventHandler(this.menuItemSettings_Click); - // - // menuItemExit - // - this.menuItemExit.Index = 1; - resources.ApplyResources(this.menuItemExit, "menuItemExit"); - this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click); - // - // menuItemHelp - // - this.menuItemHelp.Index = 1; - this.menuItemHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItemCheckUpdate, - this.menuItemAbout}); - resources.ApplyResources(this.menuItemHelp, "menuItemHelp"); - // - // menuItemCheckUpdate - // - this.menuItemCheckUpdate.Index = 0; - resources.ApplyResources(this.menuItemCheckUpdate, "menuItemCheckUpdate"); - this.menuItemCheckUpdate.Click += new System.EventHandler(this.menuItemCheckUpdate_Click); - // - // menuItemAbout - // - this.menuItemAbout.Index = 1; - resources.ApplyResources(this.menuItemAbout, "menuItemAbout"); - this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click); - // - // openFileDialogApk - // - resources.ApplyResources(this.openFileDialogApk, "openFileDialogApk"); - // - // folderBrowserDialogBuild - // - this.folderBrowserDialogBuild.ShowNewFolderButton = false; - // - // FormMain - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.dataGridView1); - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.tabControlMain); - this.DoubleBuffered = true; - this.Menu = this.mainMenu1; - this.Name = "FormMain"; - this.Shown += new System.EventHandler(this.FormMain_Shown); - this.tabControlMain.ResumeLayout(false); - this.tabPageDecode.ResumeLayout(false); - this.tabPageDecode.PerformLayout(); - this.groupBox_DECODE_Options.ResumeLayout(false); - this.tableLayoutPanel_DECODE_Options.ResumeLayout(false); - this.tableLayoutPanelDecodeOutputDir.ResumeLayout(false); - this.tableLayoutPanelDecodeOutputDir.PerformLayout(); - this.tableLayoutPanelDecodeUseFramework.ResumeLayout(false); - this.tableLayoutPanelDecodeUseFramework.PerformLayout(); - this.tabPageBuild.ResumeLayout(false); - this.tabPageBuild.PerformLayout(); - this.groupBox_BUILD_Options.ResumeLayout(false); - this.tableLayoutPanel_BUILD_Options.ResumeLayout(false); - this.tableLayoutPanelBuildOutputApk.ResumeLayout(false); - this.tableLayoutPanelBuildOutputApk.PerformLayout(); - this.tableLayoutPanelBuildUseFramework.ResumeLayout(false); - this.tableLayoutPanelBuildUseFramework.PerformLayout(); - this.tableLayoutPanelBuildUseAapt.ResumeLayout(false); - this.tableLayoutPanelBuildUseAapt.PerformLayout(); - this.tabPageInstallFramework.ResumeLayout(false); - this.tabPageInstallFramework.PerformLayout(); - this.groupBox_IF_Options.ResumeLayout(false); - this.tableLayoutPanel_IF_Options.ResumeLayout(false); - this.tableLayoutPanel_IF_Tag.ResumeLayout(false); - this.tableLayoutPanel_IF_Tag.PerformLayout(); - this.tableLayoutPanel_IF_FramePath.ResumeLayout(false); - this.tableLayoutPanel_IF_FramePath.PerformLayout(); - this.tabPageSign.ResumeLayout(false); - this.tabPageSign.PerformLayout(); - this.groupBox_SIGN_Options.ResumeLayout(false); - this.tableLayoutPanel_SIGN_Options.ResumeLayout(false); - this.tableLayoutPanel_SIGN_PrivateKey.ResumeLayout(false); - this.tableLayoutPanel_SIGN_PrivateKey.PerformLayout(); - this.tableLayoutPanel_SIGN_PublicKey.ResumeLayout(false); - this.tableLayoutPanel_SIGN_PublicKey.PerformLayout(); - this.tableLayoutPanel_SIGN_OutputFile.ResumeLayout(false); - this.tableLayoutPanel_SIGN_OutputFile.PerformLayout(); - this.tabPageZipAlign.ResumeLayout(false); - this.tabPageZipAlign.PerformLayout(); - this.groupBox_ZIPALIGN_Options.ResumeLayout(false); - this.tableLayoutPanel_ZIPALIGN_Options.ResumeLayout(false); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.ResumeLayout(false); - this.tableLayoutPanel_ZIPALIGN_AlignmentBytes.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_ZIPALIGN_AlignmentBytes)).EndInit(); - this.tableLayoutPanel_ZIPALIGN_OutputFile.ResumeLayout(false); - this.tableLayoutPanel_ZIPALIGN_OutputFile.PerformLayout(); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - this.contextMenuStripLog.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button button_DECODE_Decode; - private System.Windows.Forms.TextBox textBox_DECODE_InputAppPath; - private System.Windows.Forms.Button button_DECODE_BrowseInputAppPath; - private System.Windows.Forms.TabControl tabControlMain; - private System.Windows.Forms.TabPage tabPageDecode; - private System.Windows.Forms.TabPage tabPageSign; - private System.Windows.Forms.TextBox textBox_SIGN_InputFile; - private System.Windows.Forms.Button button_SIGN_BrowseInputFile; - private System.Windows.Forms.Button button_SIGN_Sign; - private System.Windows.Forms.TabPage tabPageZipAlign; - private System.Windows.Forms.TextBox textBox_ZIPALIGN_InputFile; - private System.Windows.Forms.Button button_ZIPALIGN_BrowseInputFile; - private System.Windows.Forms.Button button_ZIPALIGN_Align; - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateText; - private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1; - private System.Windows.Forms.DataGridView dataGridView1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelStateImage; - private System.Windows.Forms.ContextMenuStrip contextMenuStripLog; - private System.Windows.Forms.ToolStripMenuItem clearLogToolStripMenuItem; - private System.Windows.Forms.TabPage tabPageBuild; - private System.Windows.Forms.TextBox textBox_BUILD_InputProjectDir; - private System.Windows.Forms.Button button_BUILD_Build; - private System.Windows.Forms.Button button_BUILD_BrowseInputProjectDir; - private System.Windows.Forms.TabPage tabPageInstallFramework; - private System.Windows.Forms.TextBox textBox_IF_InputFramePath; - private System.Windows.Forms.Button button_IF_BrowseInputFramePath; - private System.Windows.Forms.Button button_IF_InstallFramework; - private System.Windows.Forms.MainMenu mainMenu1; - private System.Windows.Forms.MenuItem menuItemFile; - private System.Windows.Forms.MenuItem menuItemHelp; - private System.Windows.Forms.MenuItem menuItemSettings; - private System.Windows.Forms.MenuItem menuItemExit; - private System.Windows.Forms.MenuItem menuItemCheckUpdate; - private System.Windows.Forms.MenuItem menuItemAbout; - private System.Windows.Forms.GroupBox groupBox_DECODE_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_DECODE_Options; - private System.Windows.Forms.CheckBox checkBox_DECODE_MatchOriginal; - private System.Windows.Forms.CheckBox checkBox_DECODE_KeepBrokenRes; - private System.Windows.Forms.CheckBox checkBox_DECODE_Force; - private System.Windows.Forms.CheckBox checkBox_DECODE_NoRes; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelDecodeOutputDir; - private System.Windows.Forms.Button button_DECODE_BrowseOutputDirectory; - private System.Windows.Forms.CheckBox checkBox_DECODE_OutputDirectory; - private System.Windows.Forms.TextBox textBox_DECODE_OutputDirectory; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelDecodeUseFramework; - private System.Windows.Forms.TextBox textBox_DECODE_FrameDir; - private System.Windows.Forms.CheckBox checkBox_DECODE_UseFramework; - private System.Windows.Forms.Button button_DECODE_BrowseFrameDir; - private System.Windows.Forms.CheckBox checkBox_DECODE_NoSrc; - private System.Windows.Forms.GroupBox groupBox_BUILD_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_BUILD_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelBuildOutputApk; - private System.Windows.Forms.Button button_BUILD_BrowseOutputAppPath; - private System.Windows.Forms.CheckBox checkBox_BUILD_OutputAppPath; - private System.Windows.Forms.TextBox textBox_BUILD_OutputAppPath; - private System.Windows.Forms.CheckBox checkBox_BUILD_CopyOriginal; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelBuildUseFramework; - private System.Windows.Forms.Button button_BUILD_BrowseFrameDir; - private System.Windows.Forms.CheckBox checkBox_BUILD_UseFramework; - private System.Windows.Forms.TextBox textBox_BUILD_FrameDir; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelBuildUseAapt; - private System.Windows.Forms.TextBox textBox_BUILD_AaptPath; - private System.Windows.Forms.CheckBox checkBox_BUILD_UseAapt; - private System.Windows.Forms.Button button_BUILD_BrowseAaptPath; - private System.Windows.Forms.CheckBox checkBox_BUILD_ForceAll; - private System.Windows.Forms.GroupBox groupBox_IF_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_IF_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_IF_Tag; - private System.Windows.Forms.CheckBox checkBox_IF_Tag; - private System.Windows.Forms.TextBox textBox_IF_Tag; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_IF_FramePath; - private System.Windows.Forms.TextBox textBox_IF_FrameDir; - private System.Windows.Forms.CheckBox checkBox_IF_FramePath; - private System.Windows.Forms.Button button_IF_BrowseFrameDir; - private System.Windows.Forms.GroupBox groupBox_ZIPALIGN_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_ZIPALIGN_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_ZIPALIGN_AlignmentBytes; - private System.Windows.Forms.Label label_ZIPALIGN_AlignmentBytes; - private System.Windows.Forms.NumericUpDown numericUpDown_ZIPALIGN_AlignmentBytes; - private System.Windows.Forms.CheckBox checkBox_ZIPALIGN_VerboseOutput; - private System.Windows.Forms.CheckBox checkBox_ZIPALIGN_CheckAlignment; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_ZIPALIGN_OutputFile; - private System.Windows.Forms.Label label_ZIPALIGN_OutputFile; - private System.Windows.Forms.Button button_ZIPALIGN_BrowseOutputFile; - private System.Windows.Forms.TextBox textBox_ZIPALIGN_OutputFile; - private System.Windows.Forms.CheckBox checkBox_ZIPALIGN_OverwriteOutputFile; - private System.Windows.Forms.CheckBox checkBox_ZIPALIGN_Recompress; - private System.Windows.Forms.DataGridViewImageColumn ColumnImage; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnTime; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnMessage; - private System.Windows.Forms.GroupBox groupBox_SIGN_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_SIGN_Options; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_SIGN_PrivateKey; - private System.Windows.Forms.Label label_SIGN_PrivateKey; - private System.Windows.Forms.Button button_SIGN_BrowsePrivateKey; - private System.Windows.Forms.TextBox textBox_SIGN_PrivateKey; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_SIGN_PublicKey; - private System.Windows.Forms.Label label_SIGN_PublicKey; - private System.Windows.Forms.Button button_SIGN_BrowsePublicKey; - private System.Windows.Forms.TextBox textBox_SIGN_PublicKey; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_SIGN_OutputFile; - private System.Windows.Forms.Label label_SIGN_OutputFile; - private System.Windows.Forms.Button button_SIGN_BrowseOutputFile; - private System.Windows.Forms.TextBox textBox_SIGN_OutputFile; - private System.Windows.Forms.OpenFileDialog openFileDialogApk; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogBuild; - } -} - diff --git a/APKToolGUI/FormMain.cs b/APKToolGUI/FormMain.cs deleted file mode 100644 index 6585f5e..0000000 --- a/APKToolGUI/FormMain.cs +++ /dev/null @@ -1,936 +0,0 @@ -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Windows.Forms; -using Java; - -namespace APKToolGUI -{ - public partial class FormMain : Form - { - public FormMain() - { - Program.SetLanguage(); - InitializeComponent(); - this.Icon = Properties.Resources.android_thin; - this.Text += " - v" + ProductVersion; - Application.ApplicationExit += new EventHandler(Application_ApplicationExit); - - CheckAlignSwitch = !Properties.Settings.Default.MAIN_Zipalign_CheckOnly; - } - - //private void FormMain_Shown(object sender, EventArgs e) - //{ - // this.Update(); - // if (!JavaSearch.TrySearchJava(ref javaExe)) - // { - // if (MessageBox.Show(Language.DoYouWantToSelectJavaLocation, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) - // { - // OpenFileDialog openJavaExe = new OpenFileDialog() - // { - // Multiselect = false, - // Filter = "java.exe|java.exe" - // }; - // if (openJavaExe.ShowDialog() == System.Windows.Forms.DialogResult.OK) - // { - // Properties.Settings.Default.JavaExe = openJavaExe.FileName; - // Properties.Settings.Default.Save(); - // Application.Restart(); - // } - // else - // Application.Exit(); - // } - // else - // Application.Exit(); - // } - // ToLog(ApktoolEventType.Information, "Java location: " + javaExe); - - // InitializeUpdateChecker(); - // InitializeAPKTool(); - // InitializeSignApk(); - // InitializeZipalign(); - - // String javaVersion = apktoolSync.GetJavaVersionSync(); - // if (javaVersion != null) - // { - // ToLog(ApktoolEventType.Information, "Java version: " + javaVersion); - - // string apktoolVersion = apktoolSync.GetVersionSync(); - - // if (apktoolVersion != null) - // ToLog(ApktoolEventType.Information, "APKTool version: " + apktoolVersion); - // } - // else - // { - // MessageBox.Show(Language.ErrorJavaDetect, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - // } - - // TimeSpan updateInterval = DateTime.Now - Properties.Settings.Default.LastUpdateCheck; - // if (updateInterval.Days > 0 && Properties.Settings.Default.CheckForUpdateAtStartup) - // updateCheker.CheckAsync(true); - // ToStatus(Language.Done, Properties.Resources.done); - //} - - private void GetJavaPath() - { - if (!File.Exists(Properties.Settings.Default.JavaExe)) - { - javaExe = JavaUtils.SearchPath(); - if (!File.Exists(javaExe)) - { - if (MessageBox.Show(Language.DoYouWantToSelectJavaLocation, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) - { - using (OpenFileDialog openJavaExe = new OpenFileDialog()) - { - openJavaExe.Filter = "java.exe|java.exe"; - if (openJavaExe.ShowDialog() == System.Windows.Forms.DialogResult.OK) - { - javaExe = Program.GetPortablePath(openJavaExe.FileName); - Properties.Settings.Default.JavaExe = javaExe; - Properties.Settings.Default.Save(); - } - else - Environment.Exit(0); - } - } - else - Environment.Exit(0); - } - else - { - Properties.Settings.Default.JavaExe = javaExe; - Properties.Settings.Default.Save(); - } - } - - ToLog(ApktoolEventType.Information, String.Format("Java path \"{0}\"", javaExe/*"Java path: " + javaExe*/)); - } - - private void FormMain_Shown(object sender, EventArgs e) - { - this.Update(); - GetJavaPath(); - - InitializeUpdateChecker(); - InitializeAPKTool(); - InitializeSignApk(); - InitializeZipalign(); - - Version javaVer = apktool.GetJavaVersion(); - if (javaVer != null) - { - ToLog(ApktoolEventType.Information, String.Format("Java version \"{0} Update {1}\"", javaVer.Minor, javaVer.Revision)); - string apktoolVersion = apktool.GetVersion(); - if (!String.IsNullOrWhiteSpace(apktoolVersion)) - ToLog(ApktoolEventType.Information, String.Format("Apktool version \"{0}\"", apktoolVersion)); - else - ToLog(ApktoolEventType.Error, "Can't detect apktool version."); - } - else - MessageBox.Show(Language.ErrorJavaDetect, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - - TimeSpan updateInterval = DateTime.Now - Properties.Settings.Default.LastUpdateCheck; - if (updateInterval.Days > 0 && Properties.Settings.Default.CheckForUpdateAtStartup) - updateCheker.CheckAsync(true); - ToStatus(Language.Done, Properties.Resources.done); - } - - private void Application_ApplicationExit(object sender, EventArgs e) - { - Properties.Settings.Default.Save(); - } - - private string javaExe = Properties.Settings.Default.JavaExe; - Apktool apktool; - Signapk signapk; - Zipalign zipalign; - UpdateChecker updateCheker; - - #region UpdateChecker - - private void InitializeUpdateChecker() - { - updateCheker = new UpdateChecker("http://infinum.orgfree.com/_Update/APKToolGUI/version.txt", Version.Parse(Application.ProductVersion)); - updateCheker.Completed += new RunWorkerCompletedEventHandler(updateCheker_Completed); - } - - private void updateCheker_Completed(object sender, RunWorkerCompletedEventArgs e) - { - 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) == System.Windows.Forms.DialogResult.Yes) - Process.Start("http://4pda.ru/forum/index.php?showtopic=452034"); - break; - case UpdateChecker.State.NoUpdate: - if (!result.Silently) - MessageBox.Show(Language.UpdateNoUpdates, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); - break; - case UpdateChecker.State.Error: - if (!result.Silently) - MessageBox.Show("Error update checking:" + Environment.NewLine + result.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - break; - } - Properties.Settings.Default.LastUpdateCheck = DateTime.Now; - } - } - - #endregion - - #region Log&Status - - private void ToStatus(string message, Image statusImage) - { - BeginInvoke(new MethodInvoker(delegate - { - toolStripStatusLabelStateText.Text = message; - toolStripStatusLabelStateImage.Image = statusImage; - })); - } - - private void ToLog(string time, string message, Image statusImage, Color backColor) - { - if (dataGridView1.InvokeRequired) - dataGridView1.BeginInvoke(new Action(() => - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - })); - else - { - int i = dataGridView1.Rows.Add(statusImage, time, message); - dataGridView1.Rows[i].DefaultCellStyle.BackColor = backColor; - dataGridView1.FirstDisplayedScrollingRowIndex = i; - } - } - - private void ToLog(ApktoolEventType eventType, String message) - { - switch (eventType) - { - case ApktoolEventType.Information: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.info, Color.FromKnownColor(KnownColor.Window)); - //ToStatus(result.Message, Properties.Resources.info); - break; - case ApktoolEventType.Error: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.error, Color.FromKnownColor(KnownColor.LightPink)); - //ToStatus(result.Message, Properties.Resources.error); - break; - case ApktoolEventType.Warning: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.warning, Color.FromKnownColor(KnownColor.LightYellow)); - //ToStatus(result.Message, Properties.Resources.warning); - break; - case ApktoolEventType.Unknown: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.error, Color.FromKnownColor(KnownColor.LightPink)); - //ToStatus(result.Message, Properties.Resources.warning); - break; - default: - ToLog(DateTime.Now.ToString("[dd.MM.yyyy HH:mm:ss]"), message, Properties.Resources.info, Color.FromKnownColor(KnownColor.LightBlue)); - break; - } - } - - private void Done() - { - if (statusStrip1.InvokeRequired) - statusStrip1.BeginInvoke(new Action(delegate { toolStripProgressBar1.Style = ProgressBarStyle.Continuous; })); - - ActionButtonsEnabled = true; - - ToStatus(Language.Done, Properties.Resources.done); - } - - private void ClearLog() - { - if (Properties.Settings.Default.ClearLogBeforeAction) - dataGridView1.Rows.Clear(); - } - - #endregion - - #region signapk - - private void InitializeSignApk() - { - signapk = new Signapk(javaExe, Program.SIGNAPK_PATH); - signapk.Exited += signapk_SignapkExited; - } - - void signapk_SignapkExited(object sender, SignapkExitedEventArgs e) - { - if (e.ExitCode == 0) - { - ToLog(ApktoolEventType.Information, String.Format("Signing successfully completed. File saved to \"{0}\".", e.OutFilePath)); - } - Done(); - } - - private bool Singning() - { - return signapk.Sign(textBox_SIGN_PublicKey.Text, textBox_SIGN_PrivateKey.Text, textBox_SIGN_InputFile.Text, textBox_SIGN_OutputFile.Text); - } - - #endregion - - #region apktool - - private void InitializeAPKTool() - { - apktool = new Apktool(javaExe, Program.APKTOOL_PATH); - apktool.ApktoolOutputDataRecieved += apktool_ApktoolOutputDataRecieved; - apktool.ApktoolErrorDataRecieved += apktool_ApktoolErrorDataRecieved; - apktool.DecompilingCompleted += apktool_DecompilingCompleted; - apktool.BuildCompleted += apktool_BuildCompleted; - apktool.InstallFrameworkCompleted += apktool_InstallFrameworkCompleted; - } - - void apktool_InstallFrameworkCompleted(object sender, ApktoolEventCompletedEventArgs e) - { - Done(); - } - - void apktool_BuildCompleted(object sender, ApktoolEventCompletedEventArgs e) - { - Done(); - } - - void apktool_DecompilingCompleted(object sender, ApktoolEventCompletedEventArgs e) - { - if (e.ExitCode == 0) - { - ToLog(ApktoolEventType.Information, String.Format("Decompiling successfully completed. Output directory \"{0}\".", e.ProjectDir)); - } - Done(); - } - - void apktool_ApktoolErrorDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - if (e.EventType == ApktoolEventType.Unknown) - ToLog(ApktoolEventType.Error, e.Message); - else - ToLog(e.EventType, e.Message); - } - - void apktool_ApktoolOutputDataRecieved(object sender, ApktoolDataReceivedEventArgs e) - { - ToLog(e.EventType, e.Message); - } - - private bool InstallFramework() - { - InstallFrameworkOptions options = new InstallFrameworkOptions(textBox_IF_InputFramePath.Text); - if (checkBox_IF_FramePath.Checked) - options.FrameDir = textBox_IF_FrameDir.Text; - if (checkBox_IF_Tag.Checked) - options.Tag = textBox_IF_Tag.Text; - - return apktool.InstallFramework(options); - } - - private bool Decompiling() - { - //string projectDir = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text) + "\\" + System.IO.Path.GetFileNameWithoutExtension(textBox_DECODE_InputAppPath.Text); - - DecompileOptions options = new DecompileOptions(textBox_DECODE_InputAppPath.Text); - options.NoSource = checkBox_DECODE_NoSrc.Checked; - options.NoResource = checkBox_DECODE_NoRes.Checked; - options.Force = checkBox_DECODE_Force.Checked; - options.KeepBrokenResource = checkBox_DECODE_KeepBrokenRes.Checked; - options.MatchOriginal = checkBox_DECODE_MatchOriginal.Checked; - if (checkBox_DECODE_UseFramework.Checked) - options.FrameworkPath = textBox_DECODE_FrameDir.Text; - if (checkBox_DECODE_OutputDirectory.Checked) - options.OutputDirectory = textBox_DECODE_OutputDirectory.Text; - - return apktool.Decompile(options); - } - - 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); - } - - #endregion - - #region zipalign - - private void InitializeZipalign() - { - zipalign = new Zipalign(Program.ZIPALIGN_PATH); - zipalign.OutputDataReceived += zipalign_OutputDataReceived; - zipalign.ErrorDataReceived += zipalign_ErrorDataReceived; - zipalign.Exited += zipalign_Exited; - } - - void zipalign_OutputDataReceived(object sender, DataReceivedEventArgs e) - { - if (!String.IsNullOrWhiteSpace(e.Data)) - ToLog(ApktoolEventType.Information, e.Data); - } - - void zipalign_ErrorDataReceived(object sender, DataReceivedEventArgs e) - { - if (!String.IsNullOrWhiteSpace(e.Data)) - ToLog(ApktoolEventType.Error, e.Data); - } - - void zipalign_Exited(object sender, EventArgs e) - { - Zipalign za = (Zipalign)sender; - if (za.ExitCode == 0) - ToLog(ApktoolEventType.Information, "File saved to " + za.Options.OutputFile); - else - ToLog(ApktoolEventType.Warning, "Exit code: " + za.ExitCode); - Done(); - //ActionButtonsEnabled = true; - } - - private bool Align() - { - ZipalignOptions options = new ZipalignOptions(textBox_ZIPALIGN_InputFile.Text, Convert.ToInt32(numericUpDown_ZIPALIGN_AlignmentBytes.Value)); - options.CheckOnly = checkBox_ZIPALIGN_CheckAlignment.Checked; - options.OverwriteOutputFile = checkBox_ZIPALIGN_OverwriteOutputFile.Checked; - options.Recompress = checkBox_ZIPALIGN_Recompress.Checked; - options.VerboseOut = checkBox_ZIPALIGN_VerboseOutput.Checked; - options.OutputFile = textBox_ZIPALIGN_OutputFile.Text; - - return zipalign.Align(options); - } - - //void zipalign_ZipalignExited(object sender, ZipalignExitedEventArgs e) - //{ - // ToLog_Done(); - //} - - //private void ZipAlign(string inputFilePath) - //{ - // string outputFile = Path.GetDirectoryName(inputFilePath) + @"\" + Path.GetFileNameWithoutExtension(inputFilePath) + "_zipaligned.apk"; - // zipalign.Align(inputFilePath, outputFile, 4, true, false, false); - //} - - #endregion - - private bool ActionButtonsEnabled - { - set - { - if (button_BUILD_Build.InvokeRequired) - button_BUILD_Build.BeginInvoke(new Action(delegate - { - button_BUILD_Build.Enabled = value; - })); - else - button_BUILD_Build.Enabled = value; - - if (button_DECODE_Decode.InvokeRequired) - button_DECODE_Decode.BeginInvoke(new Action(delegate - { - button_DECODE_Decode.Enabled = value; - })); - else - button_DECODE_Decode.Enabled = value; - - if (button_IF_InstallFramework.InvokeRequired) - button_IF_InstallFramework.BeginInvoke(new Action(delegate - { - button_IF_InstallFramework.Enabled = value; - })); - else - button_IF_InstallFramework.Enabled = value; - if (button_ZIPALIGN_Align.InvokeRequired) - button_ZIPALIGN_Align.BeginInvoke(new Action(delegate - { - button_ZIPALIGN_Align.Enabled = value; - })); - else - button_ZIPALIGN_Align.Enabled = value; - } - } - - private void ShowMessage(string message, MessageBoxIcon status) - { - MessageBox.Show(message, Application.ProductName, MessageBoxButtons.OK, status); - } - - private bool IsValidPath(string path) - { - try - { - Path.GetFileName(path); - } - catch (ArgumentException) - { - return false; - } - return true; - - //if (path.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) != -1) - // return false; - //else - // return true; - } - - - - #region Main menu event handlers - - private void menuItemSettings_Click(object sender, EventArgs e) - { - FormSettings frm = new FormSettings(); - frm.ShowDialog(); - } - - private void menuItemExit_Click(object sender, EventArgs e) - { - Application.Exit(); - } - - private void menuItemCheckUpdate_Click(object sender, EventArgs e) - { - updateCheker.CheckAsync(); - } - - private void menuItemAbout_Click(object sender, EventArgs e) - { - FormAboutBox frm = new FormAboutBox(); - frm.ShowDialog(); - } - - #endregion - - #region Control event handlers - - private void clearLogToolStripMenuItem_Click(object sender, EventArgs e) - { - dataGridView1.Rows.Clear(); - } - - #region DECODE - - private void button_DECODE_BrowseFrameDir_Click(object sender, EventArgs e) - { - using (FolderBrowserDialog fbd = new FolderBrowserDialog()) - { - if (!String.IsNullOrWhiteSpace(textBox_DECODE_FrameDir.Text)) - fbd.SelectedPath = textBox_DECODE_FrameDir.Text; - if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_DECODE_FrameDir.Text = fbd.SelectedPath; - } - } - - private void button_DECODE_BrowseOutputDirectory_Click(object sender, EventArgs e) - { - using (FolderBrowserDialog fbd = new FolderBrowserDialog()) - { - - if (!String.IsNullOrWhiteSpace(textBox_DECODE_OutputDirectory.Text)) - fbd.SelectedPath = textBox_DECODE_OutputDirectory.Text; - else - if (!String.IsNullOrWhiteSpace(textBox_DECODE_InputAppPath.Text)) - fbd.SelectedPath = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text); - if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_DECODE_OutputDirectory.Text = fbd.SelectedPath; - } - } - - private void button_DECODE_BrowseInputAppPath_Click(object sender, EventArgs e) - { - if (openFileDialogApk.ShowDialog() == DialogResult.OK) - { - textBox_DECODE_InputAppPath.Text = openFileDialogApk.FileName; - //textBox_BUILD_InputProjectDir.Text = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text) + @"\" + Path.GetFileNameWithoutExtension(textBox_DECODE_InputAppPath.Text); - if (checkBox_DECODE_OutputDirectory.Checked) - textBox_DECODE_OutputDirectory.Text = Path.GetDirectoryName(textBox_DECODE_InputAppPath.Text) + "\\" + System.IO.Path.GetFileNameWithoutExtension(textBox_DECODE_InputAppPath.Text); - } - else - return; - } - - private void button_DECODE_Decode_Click(object sender, EventArgs e) - { - if (File.Exists(textBox_DECODE_InputAppPath.Text)) - { - if (checkBox_DECODE_UseFramework.Checked && !Directory.Exists(textBox_DECODE_FrameDir.Text)) - { - ShowMessage("Выбранный каталог фреймворков не существует.", MessageBoxIcon.Warning); - return; - } - if (checkBox_DECODE_OutputDirectory.Checked) - { - if (String.IsNullOrWhiteSpace(textBox_DECODE_OutputDirectory.Text)) - { - ShowMessage("Не выбран каталог декомпиляции.", MessageBoxIcon.Warning); - return; - } - else - if (!IsValidPath(textBox_DECODE_OutputDirectory.Text)) - { - ShowMessage("Выбранный каталог декомпиляции не может быть создан, т.к. содержит недопустимые символы.", MessageBoxIcon.Warning); - return; - } - } - bool started = Decompiling(); - if (started) - { - toolStripProgressBar1.Style = ProgressBarStyle.Marquee; - ClearLog(); - ToLog(ApktoolEventType.Information, "Decoding " + Path.GetFileName(textBox_DECODE_InputAppPath.Text)); - ToStatus(String.Format("Decoding \"{0}\"...", Path.GetFileName(textBox_DECODE_InputAppPath.Text)), Properties.Resources.waiting); - ActionButtonsEnabled = false; - } - else - ToLog(ApktoolEventType.Error, "Error. Decoding is not started."); - } - else - MessageBox.Show(Language.WarningFileForDecodingNotSelected, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - #endregion - - #region BUILD - - private void button_BUILD_BrowseAaptPath_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "Executable file|*.exe"; - if (!String.IsNullOrWhiteSpace(textBox_BUILD_AaptPath.Text)) - { - ofd.InitialDirectory = Path.GetDirectoryName(textBox_BUILD_AaptPath.Text); - ofd.FileName = Path.GetFileName(textBox_BUILD_AaptPath.Text); - } - if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_BUILD_AaptPath.Text = ofd.FileName; - } - } - - private void button_BUILD_BrowseFrameDir_Click(object sender, EventArgs e) - { - using (FolderBrowserDialog fbd = new FolderBrowserDialog()) - { - if (!String.IsNullOrWhiteSpace(textBox_BUILD_FrameDir.Text)) - fbd.SelectedPath = textBox_BUILD_FrameDir.Text; - if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_BUILD_FrameDir.Text = fbd.SelectedPath; - } - } - - private void button_BUILD_BrowseOutputAppPath_Click(object sender, EventArgs e) - { - using (SaveFileDialog sfd = new SaveFileDialog()) - { - if (!String.IsNullOrWhiteSpace(textBox_BUILD_OutputAppPath.Text)) - { - sfd.InitialDirectory = Path.GetDirectoryName(textBox_BUILD_OutputAppPath.Text); - sfd.FileName = Path.GetFileNameWithoutExtension(textBox_BUILD_OutputAppPath.Text); - sfd.DefaultExt = Path.GetExtension(textBox_BUILD_OutputAppPath.Text); - } - - if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_BUILD_OutputAppPath.Text = sfd.FileName; - } - } - - private void button_BUILD_BrowseInputProjectDir_Click(object sender, EventArgs e) - { - if (Directory.Exists(textBox_BUILD_InputProjectDir.Text)) - folderBrowserDialogBuild.SelectedPath = textBox_BUILD_InputProjectDir.Text; - if (folderBrowserDialogBuild.ShowDialog() == DialogResult.OK) - { - textBox_BUILD_InputProjectDir.Text = folderBrowserDialogBuild.SelectedPath; - if (checkBox_BUILD_OutputAppPath.Checked) - textBox_BUILD_OutputAppPath.Text = textBox_BUILD_InputProjectDir.Text + DateTime.Now.ToString("_yyyyMMdd_HH-mm-ss") + ".apk"; - //String outputAPK = textBox_BUILD_InputProjectDir.Text + DateTime.Now.ToString("_yyyyMMdd_HH-mm-ss") + ".apk"; - } - } - - private void button_BUILD_Build_Click(object sender, EventArgs e) - { - if (Directory.Exists(textBox_BUILD_InputProjectDir.Text)) - { - bool started = Build(); - if (started) - { - toolStripProgressBar1.Style = ProgressBarStyle.Marquee; - ActionButtonsEnabled = false; - ClearLog(); - ToLog(ApktoolEventType.Information, "Build " + Path.GetFileName(textBox_BUILD_InputProjectDir.Text)); - ToStatus(String.Format("Build \"{0}\"...", textBox_BUILD_InputProjectDir.Text.Replace(Path.GetDirectoryName(textBox_BUILD_InputProjectDir.Text) + @"\", String.Empty)), Properties.Resources.waiting); - } - else - ToLog(ApktoolEventType.Error, "Error. Build is not started."); - } - else - MessageBox.Show(Language.WarningDecodingFolderNotSelected, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - #endregion - - #region INSTALL FRAMEWORK - - private void button_IF_BrowseFrameDir_Click(object sender, EventArgs e) - { - using (FolderBrowserDialog fbd = new FolderBrowserDialog()) - { - if (Directory.Exists(textBox_IF_FrameDir.Text)) - fbd.SelectedPath = textBox_IF_FrameDir.Text; - if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_IF_FrameDir.Text = fbd.SelectedPath; - } - } - - private void button_IF_BrowseInputFramePath_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - if (File.Exists(textBox_IF_InputFramePath.Text)) - { - ofd.InitialDirectory = Path.GetDirectoryName(textBox_IF_InputFramePath.Text); - ofd.FileName = Path.GetFileNameWithoutExtension(textBox_IF_InputFramePath.Text); - } - ofd.Filter = "apk|*.apk|jar|*.jar"; - - if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_IF_InputFramePath.Text = ofd.FileName; - } - } - - private void button_IF_InstallFramework_Click(object sender, EventArgs e) - { - if (checkBox_IF_FramePath.Checked) - { - if (String.IsNullOrWhiteSpace(textBox_IF_FrameDir.Text) || !Directory.Exists(textBox_IF_FrameDir.Text)) - { - ShowMessage("Ошибка выбора директории фреймворка.", MessageBoxIcon.Warning); - return; - } - } - if (checkBox_IF_Tag.Checked && String.IsNullOrWhiteSpace(textBox_IF_Tag.Text)) - { - ShowMessage("Ошибка ввода тега фреймворка.", MessageBoxIcon.Warning); - return; - } - if (!File.Exists(textBox_IF_InputFramePath.Text)) - { - ShowMessage("Ошибка выбора файла фреймворка. Файл не существует.", MessageBoxIcon.Warning); - return; - } - - bool started = InstallFramework(); - if (started) - { - toolStripProgressBar1.Style = ProgressBarStyle.Marquee; - ActionButtonsEnabled = false; - ClearLog(); - ToLog(ApktoolEventType.Information, "Installing framework " + Path.GetFileName(textBox_IF_InputFramePath.Text)); - ToStatus(String.Format("Installing framework \"{0}\"...", Path.GetFileName(textBox_IF_InputFramePath.Text)), Properties.Resources.waiting); - } - else - ToLog(ApktoolEventType.Error, "Error. Framework installation is not started."); - - } - - #endregion - - #region SIGN - - private void button_SIGN_BrowsePublicKey_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "*.pem|*.pem"; - if (File.Exists(textBox_SIGN_PublicKey.Text)) - { - ofd.InitialDirectory = Path.GetDirectoryName(textBox_SIGN_PublicKey.Text); - ofd.FileName = Path.GetFileNameWithoutExtension(textBox_SIGN_PublicKey.Text); - } - if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_SIGN_PublicKey.Text = Program.GetPortablePath(ofd.FileName); - } - } - - private void button_SIGN_BrowsePrivateKey_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "*.pk8|*.pk8"; - if (File.Exists(textBox_SIGN_PrivateKey.Text)) - { - ofd.InitialDirectory = Path.GetDirectoryName(textBox_SIGN_PrivateKey.Text); - ofd.FileName = Path.GetFileNameWithoutExtension(textBox_SIGN_PrivateKey.Text); - } - if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_SIGN_PrivateKey.Text = Program.GetPortablePath(ofd.FileName); - } - } - - private void button_SIGN_BrowseOutputFile_Click(object sender, EventArgs e) - { - using (SaveFileDialog sfd = new SaveFileDialog()) - { - sfd.Filter = "(*.apk)|*.apk|(*.jar)|*.jar|(*.zip)|*.zip"; - - if (File.Exists(textBox_SIGN_InputFile.Text)) - { - sfd.Filter = String.Format("(*{0})|*{0}", Path.GetExtension(textBox_SIGN_InputFile.Text)); - sfd.InitialDirectory = Path.GetDirectoryName(textBox_SIGN_InputFile.Text); - sfd.FileName = String.Format("{0}_signed{1}", Path.GetFileNameWithoutExtension(textBox_SIGN_InputFile.Text), Path.GetExtension(textBox_SIGN_InputFile.Text)); - } - - if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - { - textBox_SIGN_OutputFile.Text = sfd.FileName; - } - } - } - - private void button_SIGN_BrowseInputFile_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "(*.apk;*.jar;*.zip)|*.apk;*.jar;*.zip"; - - if (ofd.ShowDialog() == DialogResult.OK) - { - textBox_SIGN_InputFile.Text = ofd.FileName; - textBox_SIGN_OutputFile.Text = - String.Format("{0}{1}{2}_signed{3}", - Path.GetDirectoryName(textBox_SIGN_InputFile.Text), - Path.DirectorySeparatorChar, - Path.GetFileNameWithoutExtension(textBox_SIGN_InputFile.Text), - Path.GetExtension(textBox_SIGN_InputFile.Text)); - } - } - } - - private void button_SIGN_Sign_Click(object sender, EventArgs e) - { - if (!File.Exists(textBox_SIGN_PublicKey.Text)) - { - ShowMessage("Public key not found.", MessageBoxIcon.Warning); - return; - } - if (!File.Exists(textBox_SIGN_PrivateKey.Text)) - { - ShowMessage("Private key not found.", MessageBoxIcon.Warning); - return; - } - if (!File.Exists(textBox_SIGN_InputFile.Text)) - { - ShowMessage("Input file not found.", MessageBoxIcon.Warning); - return; - } - - bool started = Singning(); - if (started) - { - toolStripProgressBar1.Style = ProgressBarStyle.Marquee; - ActionButtonsEnabled = false; - ClearLog(); - ToLog(ApktoolEventType.Information, "Signing " + Path.GetFileName(textBox_SIGN_InputFile.Text)); - ToStatus(String.Format("Signing \"{0}\"...", Path.GetFileName(textBox_SIGN_InputFile.Text)), Properties.Resources.waiting); - } - else - ToLog(ApktoolEventType.Error, "Error. Signing is not started."); - } - - #endregion - - #region ZIPALIGN - - private bool CheckAlignSwitch - { - set - { - checkBox_ZIPALIGN_Recompress.Enabled = value; - checkBox_ZIPALIGN_OverwriteOutputFile.Enabled = value; - tableLayoutPanel_ZIPALIGN_OutputFile.Enabled = value; - } - } - - private void checkBox_ZIPALIGN_CheckAlignment_CheckedChanged(object sender, EventArgs e) - { - CheckAlignSwitch = !checkBox_ZIPALIGN_CheckAlignment.Checked; - } - - private void button_ZIPALIGN_BrowseOutputFile_Click(object sender, EventArgs e) - { - using (SaveFileDialog sfd = new SaveFileDialog()) - { - if (File.Exists(textBox_ZIPALIGN_InputFile.Text)) - { - sfd.InitialDirectory = Path.GetDirectoryName(textBox_ZIPALIGN_InputFile.Text); - sfd.Filter = String.Format("{0}|*.{0}", Path.GetExtension(textBox_ZIPALIGN_InputFile.Text).Replace(".", String.Empty)); - sfd.FileName = String.Format("{0}_zipaligned", Path.GetFileNameWithoutExtension(textBox_ZIPALIGN_InputFile.Text)); - } - if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBox_ZIPALIGN_OutputFile.Text = sfd.FileName; - } - } - - private void button_ZIPALIGN_BrowseInputFile_Click(object sender, EventArgs e) - { - using (OpenFileDialog ofd = new OpenFileDialog()) - { - ofd.Filter = "ZIP archives(*.apk;*.zip;*.jar)|*.apk;*.zip;*.jar"; - if (File.Exists(textBox_ZIPALIGN_InputFile.Text)) - { - ofd.InitialDirectory = Path.GetDirectoryName(textBox_ZIPALIGN_InputFile.Text); - ofd.FileName = Path.GetFileName(textBox_ZIPALIGN_InputFile.Text); - } - if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) - { - textBox_ZIPALIGN_InputFile.Text = ofd.FileName; - if (!checkBox_ZIPALIGN_CheckAlignment.Checked) - textBox_ZIPALIGN_OutputFile.Text = String.Format("{0}\\{1}_zipaligned{2}", - Path.GetDirectoryName(ofd.FileName), - Path.GetFileNameWithoutExtension(ofd.FileName), - Path.GetExtension(ofd.FileName)); - } - } - } - - private void button_ZIPALIGN_Align_Click(object sender, EventArgs e) - { - if (!File.Exists(textBox_ZIPALIGN_InputFile.Text)) - { - ShowMessage("Ошибка. Выбранный файл не существует.", MessageBoxIcon.Warning); - return; - } - - bool started = Align(); - if (started) - { - toolStripProgressBar1.Style = ProgressBarStyle.Marquee; - ActionButtonsEnabled = false; - ClearLog(); - ToLog(ApktoolEventType.Information, "Aligning " + Path.GetFileName(textBox_ZIPALIGN_InputFile.Text)); - ToStatus(String.Format("Aligning \"{0}\"...", Path.GetFileName(textBox_ZIPALIGN_InputFile.Text)), Properties.Resources.waiting); - } - else - ToLog(ApktoolEventType.Error, "Error. Aligning is not started."); - } - - #endregion - - #endregion - } -} \ No newline at end of file diff --git a/APKToolGUI/FormMain.resx b/APKToolGUI/FormMain.resx deleted file mode 100644 index 74ea77c..0000000 --- a/APKToolGUI/FormMain.resx +++ /dev/null @@ -1,3276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Top, Right - - - System - - - NoControl - - - - 569, 304 - - - 4, 4, 4, 4 - - - 37, 35 - - - - 5 - - - ... - - - button_DECODE_BrowseInputAppPath - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageDecode - - - 3 - - - Top, Right - - - System - - - NoControl - - - 613, 304 - - - 4, 4, 4, 4 - - - 140, 35 - - - 3 - - - Decompile - - - button_DECODE_Decode - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageDecode - - - 2 - - - Top, Left, Right - - - Top, Left, Right - - - 1 - - - Fill - - - NoControl - - - 4, 152 - - - 4, 4, 4, 4 - - - 729, 29 - - - 6 - - - Keeps files to closest to original as possible. Prevents rebuild. - - - checkBox_DECODE_MatchOriginal - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 0 - - - Fill - - - NoControl - - - 4, 115 - - - 4, 4, 4, 4 - - - 729, 29 - - - 5 - - - Keep broken resource. - - - checkBox_DECODE_KeepBrokenRes - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 1 - - - Fill - - - NoControl - - - 4, 78 - - - 4, 4, 4, 4 - - - 729, 29 - - - 4 - - - Force delete destination directory. - - - checkBox_DECODE_Force - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 2 - - - Fill - - - NoControl - - - 4, 41 - - - 4, 4, 4, 4 - - - 729, 29 - - - 3 - - - Do not decode resources. - - - checkBox_DECODE_NoRes - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 3 - - - 3 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_DECODE_BrowseOutputDirectory - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeOutputDir - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Output directory: - - - checkBox_DECODE_OutputDirectory - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeOutputDir - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_DECODE_OutputDirectory - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeOutputDir - - - 2 - - - Fill - - - 0, 222 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 0 - - - tableLayoutPanelDecodeOutputDir - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 4 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button_DECODE_BrowseOutputDirectory" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="checkBox_DECODE_OutputDirectory" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox_DECODE_OutputDirectory" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - 3 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 5 - - - textBox_DECODE_FrameDir - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeUseFramework - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Uses framework files located in: - - - checkBox_DECODE_UseFramework - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeUseFramework - - - 1 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 6 - - - ... - - - button_DECODE_BrowseFrameDir - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelDecodeUseFramework - - - 2 - - - Fill - - - 0, 185 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 1 - - - tableLayoutPanelDecodeUseFramework - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 5 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textBox_DECODE_FrameDir" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_DECODE_UseFramework" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_DECODE_BrowseFrameDir" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 729, 29 - - - 2 - - - Do not decode sources. - - - checkBox_DECODE_NoSrc - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_DECODE_Options - - - 6 - - - Fill - - - 4, 23 - - - 4, 4, 4, 4 - - - 8 - - - 737, 259 - - - 0 - - - tableLayoutPanel_DECODE_Options - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox_DECODE_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="checkBox_DECODE_MatchOriginal" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_DECODE_KeepBrokenRes" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_DECODE_Force" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_DECODE_NoRes" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanelDecodeOutputDir" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanelDecodeUseFramework" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_DECODE_NoSrc" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,AutoSize,0" /></TableLayoutSettings> - - - 8, 9 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 745, 286 - - - 6 - - - Options - - - groupBox_DECODE_Options - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageDecode - - - 0 - - - Top, Left, Right - - - 8, 305 - - - 4, 4, 4, 4 - - - 557, 26 - - - 4 - - - textBox_DECODE_InputAppPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageDecode - - - 1 - - - 4, 28 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 764, 354 - - - 0 - - - Decode - - - tabPageDecode - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControlMain - - - 0 - - - Top, Left, Right - - - 1 - - - 3 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_BUILD_BrowseOutputAppPath - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildOutputApk - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Output app: - - - checkBox_BUILD_OutputAppPath - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildOutputApk - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_BUILD_OutputAppPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildOutputApk - - - 2 - - - Fill - - - 0, 148 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 4 - - - tableLayoutPanelBuildOutputApk - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_BUILD_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button_BUILD_BrowseOutputAppPath" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="checkBox_BUILD_OutputAppPath" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox_BUILD_OutputAppPath" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - NoControl - - - 4, 41 - - - 4, 4, 4, 4 - - - 729, 29 - - - 3 - - - Copies original AndroidManifest.xml and META-INF folder into built apk - - - checkBox_BUILD_CopyOriginal - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_BUILD_Options - - - 1 - - - 3 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_BUILD_BrowseFrameDir - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseFramework - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Uses framework files located in: - - - checkBox_BUILD_UseFramework - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseFramework - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_BUILD_FrameDir - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseFramework - - - 2 - - - Fill - - - 0, 111 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 0 - - - tableLayoutPanelBuildUseFramework - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_BUILD_Options - - - 2 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button_BUILD_BrowseFrameDir" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="checkBox_BUILD_UseFramework" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox_BUILD_FrameDir" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - 3 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 5 - - - textBox_BUILD_AaptPath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseAapt - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Uses aapt.exe located in: - - - checkBox_BUILD_UseAapt - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseAapt - - - 1 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 6 - - - ... - - - button_BUILD_BrowseAaptPath - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanelBuildUseAapt - - - 2 - - - Fill - - - 0, 74 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 1 - - - tableLayoutPanelBuildUseAapt - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_BUILD_Options - - - 3 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textBox_BUILD_AaptPath" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_BUILD_UseAapt" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_BUILD_BrowseAaptPath" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 729, 29 - - - 2 - - - Skip changes detection and build all files. - - - checkBox_BUILD_ForceAll - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_BUILD_Options - - - 4 - - - Fill - - - 4, 23 - - - 4, 4, 4, 4 - - - 6 - - - 737, 186 - - - 0 - - - tableLayoutPanel_BUILD_Options - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox_BUILD_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanelBuildOutputApk" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_BUILD_CopyOriginal" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanelBuildUseFramework" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanelBuildUseAapt" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_BUILD_ForceAll" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,AutoSize,0,Absolute,29,Absolute,29" /></TableLayoutSettings> - - - 8, 9 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 745, 213 - - - 9 - - - Options - - - groupBox_BUILD_Options - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageBuild - - - 0 - - - Top, Right - - - System - - - NoControl - - - 569, 304 - - - 4, 4, 4, 4 - - - 37, 35 - - - 8 - - - ... - - - button_BUILD_BrowseInputProjectDir - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageBuild - - - 1 - - - Top, Right - - - System - - - NoControl - - - 613, 304 - - - 4, 4, 4, 4 - - - 140, 35 - - - 6 - - - Build - - - button_BUILD_Build - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageBuild - - - 2 - - - Top, Left, Right - - - 8, 305 - - - 4, 4, 4, 4 - - - 557, 26 - - - 7 - - - textBox_BUILD_InputProjectDir - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageBuild - - - 3 - - - 4, 28 - - - 4, 4, 4, 4 - - - 764, 354 - - - 3 - - - Build - - - tabPageBuild - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControlMain - - - 1 - - - Top, Left, Right - - - 1 - - - 2 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 342, 29 - - - 3 - - - Tag frameworks using: - - - checkBox_IF_Tag - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_Tag - - - 0 - - - Fill - - - 351, 1 - - - 1, 1, 4, 1 - - - 382, 26 - - - 4 - - - textBox_IF_Tag - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_Tag - - - 1 - - - Fill - - - 0, 37 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 0 - - - tableLayoutPanel_IF_Tag - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="checkBox_IF_Tag" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox_IF_Tag" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,47,55877,Percent,52,44123" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - 3 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 5 - - - textBox_IF_FrameDir - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_FramePath - - - 0 - - - Fill - - - NoControl - - - 4, 4 - - - 4, 4, 4, 4 - - - 341, 29 - - - 3 - - - Stores framework files into: - - - checkBox_IF_FramePath - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_FramePath - - - 1 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 6 - - - ... - - - button_IF_BrowseFrameDir - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_FramePath - - - 2 - - - Fill - - - 0, 0 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 1 - - - tableLayoutPanel_IF_FramePath - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_IF_Options - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textBox_IF_FrameDir" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_IF_FramePath" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_IF_BrowseFrameDir" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - 4, 23 - - - 4, 4, 4, 4 - - - 3 - - - 737, 77 - - - 0 - - - tableLayoutPanel_IF_Options - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox_IF_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel_IF_Tag" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel_IF_FramePath" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,37,Absolute,37,AutoSize,0,Absolute,29" /></TableLayoutSettings> - - - 8, 9 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 745, 104 - - - 10 - - - Options - - - groupBox_IF_Options - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageInstallFramework - - - 0 - - - Top, Right - - - System - - - NoControl - - - 613, 304 - - - 4, 4, 4, 4 - - - 140, 35 - - - 1 - - - Install - - - button_IF_InstallFramework - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageInstallFramework - - - 1 - - - Top, Right - - - System - - - NoControl - - - 569, 304 - - - 4, 4, 4, 4 - - - 37, 35 - - - 0 - - - ... - - - button_IF_BrowseInputFramePath - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageInstallFramework - - - 2 - - - Top, Left, Right - - - 8, 305 - - - 4, 4, 4, 4 - - - 557, 26 - - - 9 - - - textBox_IF_InputFramePath - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageInstallFramework - - - 3 - - - 4, 28 - - - 4, 4, 4, 4 - - - 764, 354 - - - 4 - - - Install Framework - - - tabPageInstallFramework - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControlMain - - - 2 - - - Top, Left, Right - - - 1 - - - 3 - - - True - - - Fill - - - NoControl - - - 3, 3 - - - 3, 3, 3, 3 - - - 343, 31 - - - 8 - - - Private key - - - MiddleLeft - - - label_SIGN_PrivateKey - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PrivateKey - - - 0 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_SIGN_BrowsePrivateKey - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PrivateKey - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_SIGN_PrivateKey - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PrivateKey - - - 2 - - - Fill - - - 0, 37 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 6 - - - tableLayoutPanel_SIGN_PrivateKey - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label_SIGN_PrivateKey" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_SIGN_BrowsePrivateKey" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBox_SIGN_PrivateKey" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - 3 - - - True - - - Fill - - - NoControl - - - 3, 3 - - - 3, 3, 3, 3 - - - 343, 31 - - - 8 - - - Public key - - - MiddleLeft - - - label_SIGN_PublicKey - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PublicKey - - - 0 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_SIGN_BrowsePublicKey - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PublicKey - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_SIGN_PublicKey - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_PublicKey - - - 2 - - - Fill - - - 0, 0 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 5 - - - tableLayoutPanel_SIGN_PublicKey - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_Options - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label_SIGN_PublicKey" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_SIGN_BrowsePublicKey" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBox_SIGN_PublicKey" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - 3 - - - True - - - Fill - - - NoControl - - - 3, 3 - - - 3, 3, 3, 3 - - - 343, 31 - - - 8 - - - Output file - - - MiddleLeft - - - label_SIGN_OutputFile - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_OutputFile - - - 0 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_SIGN_BrowseOutputFile - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_OutputFile - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_SIGN_OutputFile - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_OutputFile - - - 2 - - - Fill - - - 0, 74 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 4 - - - tableLayoutPanel_SIGN_OutputFile - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_SIGN_Options - - - 2 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label_SIGN_OutputFile" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_SIGN_BrowseOutputFile" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBox_SIGN_OutputFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - 4, 23 - - - 4, 4, 4, 4 - - - 4 - - - 737, 113 - - - 0 - - - tableLayoutPanel_SIGN_Options - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox_SIGN_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel_SIGN_PrivateKey" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel_SIGN_PublicKey" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel_SIGN_OutputFile" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,37,Absolute,37,Absolute,37,AutoSize,0,Absolute,29,Absolute,29,Absolute,29" /></TableLayoutSettings> - - - 8, 9 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 745, 140 - - - 17 - - - Options - - - groupBox_SIGN_Options - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageSign - - - 0 - - - Top, Left, Right - - - 8, 305 - - - 4, 4, 4, 4 - - - 557, 26 - - - 9 - - - textBox_SIGN_InputFile - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageSign - - - 1 - - - Top, Right - - - System - - - NoControl - - - 569, 304 - - - 4, 4, 4, 4 - - - 37, 35 - - - 0 - - - ... - - - button_SIGN_BrowseInputFile - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageSign - - - 2 - - - Top, Right - - - System - - - NoControl - - - 613, 304 - - - 4, 4, 4, 4 - - - 140, 35 - - - 1 - - - Sign - - - button_SIGN_Sign - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageSign - - - 3 - - - 4, 28 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 764, 354 - - - 1 - - - Sign - - - tabPageSign - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControlMain - - - 3 - - - Top, Left, Right - - - 1 - - - Fill - - - NoControl - - - 4, 115 - - - 4, 4, 4, 4 - - - 729, 29 - - - 8 - - - Recompress using Zopfli - - - checkBox_ZIPALIGN_Recompress - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 0 - - - 2 - - - True - - - Fill - - - NoControl - - - 3, 3 - - - 3, 3, 3, 3 - - - 686, 31 - - - 0 - - - Alignment in bytes, e.g. '4' provides 32-bit alignment - - - MiddleLeft - - - label_ZIPALIGN_AlignmentBytes - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_AlignmentBytes - - - 0 - - - Fill - - - 693, 1 - - - 1, 1, 1, 1 - - - 43, 26 - - - 1 - - - Center - - - numericUpDown_ZIPALIGN_AlignmentBytes - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_AlignmentBytes - - - 1 - - - Fill - - - 0, 0 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 7 - - - tableLayoutPanel_ZIPALIGN_AlignmentBytes - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label_ZIPALIGN_AlignmentBytes" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="numericUpDown_ZIPALIGN_AlignmentBytes" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,45,Absolute,27" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - NoControl - - - 4, 78 - - - 4, 4, 4, 4 - - - 729, 29 - - - 6 - - - Verbose output - - - checkBox_ZIPALIGN_VerboseOutput - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 2 - - - Fill - - - NoControl - - - 4, 41 - - - 4, 4, 4, 4 - - - 729, 29 - - - 5 - - - Check alignment only (does not modify file) - - - checkBox_ZIPALIGN_CheckAlignment - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 3 - - - 3 - - - True - - - Fill - - - NoControl - - - 3, 3 - - - 3, 3, 3, 3 - - - 343, 31 - - - 8 - - - Output file - - - MiddleLeft - - - label_ZIPALIGN_OutputFile - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_OutputFile - - - 0 - - - NoControl - - - 699, 0 - - - 1, 0, 1, 1 - - - 35, 35 - - - 7 - - - ... - - - button_ZIPALIGN_BrowseOutputFile - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_OutputFile - - - 1 - - - Fill - - - 350, 1 - - - 1, 1, 1, 1 - - - 347, 26 - - - 4 - - - textBox_ZIPALIGN_OutputFile - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_OutputFile - - - 2 - - - Fill - - - 0, 185 - - - 0, 0, 0, 0 - - - 1 - - - 737, 37 - - - 4 - - - tableLayoutPanel_ZIPALIGN_OutputFile - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 4 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label_ZIPALIGN_OutputFile" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button_ZIPALIGN_BrowseOutputFile" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="textBox_ZIPALIGN_OutputFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,50,Percent,50,Absolute,39" /><Rows Styles="AutoSize,0" /></TableLayoutSettings> - - - Fill - - - NoControl - - - 4, 152 - - - 4, 4, 4, 4 - - - 729, 29 - - - 3 - - - Overwrite existing output file - - - checkBox_ZIPALIGN_OverwriteOutputFile - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel_ZIPALIGN_Options - - - 5 - - - Fill - - - 4, 23 - - - 4, 4, 4, 4 - - - 7 - - - 737, 223 - - - 0 - - - tableLayoutPanel_ZIPALIGN_Options - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox_ZIPALIGN_Options - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="checkBox_ZIPALIGN_Recompress" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel_ZIPALIGN_AlignmentBytes" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_ZIPALIGN_VerboseOutput" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_ZIPALIGN_CheckAlignment" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel_ZIPALIGN_OutputFile" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBox_ZIPALIGN_OverwriteOutputFile" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,Absolute,37,AutoSize,0" /></TableLayoutSettings> - - - 8, 9 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 745, 250 - - - 16 - - - Options - - - groupBox_ZIPALIGN_Options - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageZipAlign - - - 0 - - - Top, Right - - - System - - - NoControl - - - 613, 304 - - - 4, 4, 4, 4 - - - 140, 35 - - - 15 - - - Align - - - button_ZIPALIGN_Align - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageZipAlign - - - 1 - - - Top, Right - - - System - - - NoControl - - - 569, 304 - - - 4, 4, 4, 4 - - - 37, 35 - - - 0 - - - ... - - - button_ZIPALIGN_BrowseInputFile - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageZipAlign - - - 2 - - - Top, Left, Right - - - 8, 305 - - - 4, 4, 4, 4 - - - 557, 26 - - - 9 - - - textBox_ZIPALIGN_InputFile - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageZipAlign - - - 3 - - - 4, 28 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 764, 354 - - - 2 - - - Zip align - - - tabPageZipAlign - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControlMain - - - 4 - - - 12, 13 - - - 0, 0, 0, 0 - - - 772, 386 - - - 15 - - - tabControlMain - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - 172, 17 - - - 0, 700 - - - 1, 0, 19, 0 - - - 793, 29 - - - 17 - - - statusStrip1 - - - statusStrip1 - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 0, 24 - - - toolStripStatusLabel1 - - - MiddleLeft - - - None - - - 638, 24 - - - Loading... - - - MiddleLeft - - - False - - - 133, 23 - - - Top, Bottom, Left, Right - - - 24 - - - True - - - - - - 20 - - - True - - - Time - - - 68 - - - True - - - Message - - - 478, 17 - - - 139, 28 - - - contextMenuStripLog - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Microsoft Sans Serif, 8.25pt - - - 12, 403 - - - 4, 4, 4, 4 - - - Vertical - - - 769, 281 - - - 0 - - - dataGridView1 - - - System.Windows.Forms.DataGridView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 138, 24 - - - Clear log - - - 647, 17 - - - File - - - Settings - - - Exit - - - Help - - - Check for update - - - About - - - 17, 17 - - - apk, jar|*.apk;*.jar|*.*|*.* - - - 288, 17 - - - True - - - 33 - - - 8, 19 - - - 793, 729 - - - Segoe UI, 8.25pt - - - 4, 4, 4, 4 - - - 127, 124 - - - CenterScreen - - - APKTool GUI - - - toolStripStatusLabelStateImage - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripStatusLabelStateText - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - toolStripProgressBar1 - - - System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnImage - - - System.Windows.Forms.DataGridViewImageColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnTime - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnMessage - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - clearLogToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - mainMenu1 - - - System.Windows.Forms.MainMenu, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemFile - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemSettings - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemExit - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemHelp - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemCheckUpdate - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - menuItemAbout - - - System.Windows.Forms.MenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - openFileDialogApk - - - System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - folderBrowserDialogBuild - - - System.Windows.Forms.FolderBrowserDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - FormMain - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/APKToolGUI/FormMain.ru.resx b/APKToolGUI/FormMain.ru.resx deleted file mode 100644 index 98bc5c8..0000000 --- a/APKToolGUI/FormMain.ru.resx +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Использовать файлы фремворка из: - - - Перезаписывать файлы в каталоге назначения - - - Не декомпилировать ресурсы - - - Не декомпилировать исходный код - - - Использовать aapt.exe из - - - Пропустить определение изменений и построить все файлы - - - - 57, 18 - - - Время - - - - 65 - - - Сообщение - - - 171, 22 - - - Очистить журнал - - - 172, 26 - - - Настройки - - - Выход - - - Файл - - - Проверить обновление - - - О программе - - - Справка - - - Собрать - - - Декомпилировать - - - Выравнивание - - - Подпись - - - Загрузка... - - - Выберите файл для подписи - - - Копировать оригинальный AndroidManifest.xml и папку META-INF в построенный apk - - - Использовать файлы фремворка из: - - - Сохранить испорченные ресурсы - - - Сборка - - - Декомпиляция - - - Декомпилировать в каталог: - - - Сохранить файл как: - - - Установка фреймворков - - - Опции - - - Опции - - - Опции - - - Установить - - - Выровнять - - - Сохранить файл как: - - - Опции - - - Перезаписать выходной файл, если он существует - - - Подписать - - - Устанавливать фреймворк в каталог: - - - Перепаковать с использованием алгоритма Zopfli - - - Подробный вывод - - - Выравнивание (в байтах), например, '4' для 32-битного выравнивания - - - Сохранять файлы близко к оригиналу, насколько это возможно. Предотвращает ребилд. - - - Только проверить выравнивание (не модифицирует файл) - - - Опции - - - Сохранить файл как: - - - Закрытый ключ - - - Открытый ключ - - \ No newline at end of file diff --git a/APKToolGUI/FormSettings.Designer.cs b/APKToolGUI/FormSettings.Designer.cs deleted file mode 100644 index b38c271..0000000 --- a/APKToolGUI/FormSettings.Designer.cs +++ /dev/null @@ -1,229 +0,0 @@ -namespace APKToolGUI -{ - partial class FormSettings - { - /// - /// Требуется переменная конструктора. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Освободить все используемые ресурсы. - /// - /// истинно, если управляемый ресурс должен быть удален; иначе ложно. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Код, автоматически созданный конструктором форм Windows - - /// - /// Обязательный метод для поддержки конструктора - не изменяйте - /// содержимое данного метода при помощи редактора кода. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSettings)); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.checkBoxCheckUpdateStartup = new System.Windows.Forms.CheckBox(); - this.groupBoxJava = new System.Windows.Forms.GroupBox(); - this.labelCustomJavaLocation = new System.Windows.Forms.Label(); - this.textBoxCustomJavaLocation = new System.Windows.Forms.TextBox(); - this.buttonCustomJavaLocation = new System.Windows.Forms.Button(); - this.groupBoxLanguage = new System.Windows.Forms.GroupBox(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.groupBoxContextMenu = new System.Windows.Forms.GroupBox(); - 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.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBoxJava.SuspendLayout(); - this.groupBoxLanguage.SuspendLayout(); - this.groupBoxContextMenu.SuspendLayout(); - this.SuspendLayout(); - // - // tabControl1 - // - resources.ApplyResources(this.tabControl1, "tabControl1"); - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - // - // tabPage1 - // - resources.ApplyResources(this.tabPage1, "tabPage1"); - this.tabPage1.Controls.Add(this.groupBox1); - this.tabPage1.Controls.Add(this.groupBoxJava); - this.tabPage1.Controls.Add(this.groupBoxLanguage); - this.tabPage1.Controls.Add(this.groupBoxContextMenu); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // groupBox1 - // - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Controls.Add(this.checkBox1); - this.groupBox1.Controls.Add(this.checkBoxCheckUpdateStartup); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // - // 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; - // - // groupBoxJava - // - resources.ApplyResources(this.groupBoxJava, "groupBoxJava"); - this.groupBoxJava.Controls.Add(this.labelCustomJavaLocation); - this.groupBoxJava.Controls.Add(this.textBoxCustomJavaLocation); - this.groupBoxJava.Controls.Add(this.buttonCustomJavaLocation); - this.groupBoxJava.Name = "groupBoxJava"; - this.groupBoxJava.TabStop = false; - // - // labelCustomJavaLocation - // - resources.ApplyResources(this.labelCustomJavaLocation, "labelCustomJavaLocation"); - this.labelCustomJavaLocation.Name = "labelCustomJavaLocation"; - // - // 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; - // - // buttonCustomJavaLocation - // - resources.ApplyResources(this.buttonCustomJavaLocation, "buttonCustomJavaLocation"); - this.buttonCustomJavaLocation.Name = "buttonCustomJavaLocation"; - this.buttonCustomJavaLocation.UseVisualStyleBackColor = true; - this.buttonCustomJavaLocation.Click += new System.EventHandler(this.buttonCustomJavaLocation_Click); - // - // groupBoxLanguage - // - resources.ApplyResources(this.groupBoxLanguage, "groupBoxLanguage"); - this.groupBoxLanguage.Controls.Add(this.comboBox1); - this.groupBoxLanguage.Name = "groupBoxLanguage"; - this.groupBoxLanguage.TabStop = false; - // - // comboBox1 - // - resources.ApplyResources(this.comboBox1, "comboBox1"); - this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Name = "comboBox1"; - // - // groupBoxContextMenu - // - resources.ApplyResources(this.groupBoxContextMenu, "groupBoxContextMenu"); - this.groupBoxContextMenu.Controls.Add(this.labelAdminRights); - this.groupBoxContextMenu.Controls.Add(this.buttonAddContextMenu); - this.groupBoxContextMenu.Controls.Add(this.buttonRemoveContextMenu); - this.groupBoxContextMenu.Name = "groupBoxContextMenu"; - this.groupBoxContextMenu.TabStop = false; - // - // labelAdminRights - // - resources.ApplyResources(this.labelAdminRights, "labelAdminRights"); - this.labelAdminRights.Name = "labelAdminRights"; - // - // buttonAddContextMenu - // - resources.ApplyResources(this.buttonAddContextMenu, "buttonAddContextMenu"); - this.buttonAddContextMenu.Name = "buttonAddContextMenu"; - this.buttonAddContextMenu.UseVisualStyleBackColor = true; - this.buttonAddContextMenu.Click += new System.EventHandler(this.buttonAddContextMenu_Click); - // - // buttonRemoveContextMenu - // - resources.ApplyResources(this.buttonRemoveContextMenu, "buttonRemoveContextMenu"); - this.buttonRemoveContextMenu.Name = "buttonRemoveContextMenu"; - this.buttonRemoveContextMenu.UseVisualStyleBackColor = true; - this.buttonRemoveContextMenu.Click += new System.EventHandler(this.buttonRemoveContextMenu_Click); - // - // buttonCancel - // - resources.ApplyResources(this.buttonCancel, "buttonCancel"); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - // - // buttonОК - // - resources.ApplyResources(this.buttonОК, "buttonОК"); - this.buttonОК.Name = "buttonОК"; - this.buttonОК.UseVisualStyleBackColor = true; - this.buttonОК.Click += new System.EventHandler(this.buttonОК_Click); - // - // FormSettings - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonОК); - this.Controls.Add(this.tabControl1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FormSettings"; - this.Load += new System.EventHandler(this.FormSettings_Load); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBoxJava.ResumeLayout(false); - this.groupBoxJava.PerformLayout(); - this.groupBoxLanguage.ResumeLayout(false); - this.groupBoxContextMenu.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.GroupBox groupBoxJava; - private System.Windows.Forms.GroupBox groupBoxLanguage; - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.GroupBox groupBoxContextMenu; - private System.Windows.Forms.Label labelAdminRights; - private System.Windows.Forms.Button buttonAddContextMenu; - private System.Windows.Forms.Button buttonRemoveContextMenu; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.Button buttonОК; - private System.Windows.Forms.TextBox textBoxCustomJavaLocation; - private System.Windows.Forms.Button buttonCustomJavaLocation; - private System.Windows.Forms.Label labelCustomJavaLocation; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.CheckBox checkBoxCheckUpdateStartup; - private System.Windows.Forms.CheckBox checkBox1; - - } -} \ No newline at end of file diff --git a/APKToolGUI/FormSettings.cs b/APKToolGUI/FormSettings.cs deleted file mode 100644 index 019c1b0..0000000 --- a/APKToolGUI/FormSettings.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.IO; - -namespace APKToolGUI -{ - public partial class FormSettings : Form - { - public FormSettings() - { - InitializeComponent(); - if (!ExplorerContextMenu.IsAdmin()) - { - SetButtonShield(buttonAddContextMenu, true); - SetButtonShield(buttonRemoveContextMenu, true); - } - } - - #region GUI - - private void FormSettings_Load(object sender, EventArgs e) - { - LoadSettings(); - } - - private void buttonОК_Click(object sender, EventArgs e) - { - SaveSettings(); - this.Close(); - } - - [DllImport("user32.dll", CharSet = CharSet.Unicode)] - public static extern IntPtr SendMessage(HandleRef hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); - - private static void SetButtonShield(Button btn, bool showShield) - { - // BCM_SETSHIELD = 0x0000160C - SendMessage(new HandleRef(btn, btn.Handle), 0x160C, IntPtr.Zero, showShield ? new IntPtr(1) : IntPtr.Zero); - } - - private void buttonAddContextMenu_Click(object sender, EventArgs e) - { - if(MessageBox.Show(Language.DoYouRealyWantToInstallCM, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) - RunAsAdmin(Application.ExecutablePath, "ccm"); - } - - private void buttonRemoveContextMenu_Click(object sender, EventArgs e) - { - if (MessageBox.Show(Language.DoYouRealyWantToRemoveCM, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) - RunAsAdmin(Application.ExecutablePath, "rcm"); - } - - #endregion - - private void LoadSettings() - { - //textBox1.Font = Properties.Settings.Default.FontLogMainWindow; - //textBox2.Font = Properties.Settings.Default.FontLogContextMenuWindow; - //textBox1.Text = textBox1.Font.Name + ", " + textBox1.Font.Size; - //textBox2.Text = textBox2.Font.Name + ", " + textBox2.Font.Size; - - String sysLang = Language.SystemLanguage; - comboBox1.Items.Add(sysLang); - comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("ru")); - comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("en")); - //comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("uk")); - //comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("ru-RU")); - //comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("en-US")); - //comboBox1.Items.Add(System.Globalization.CultureInfo.GetCultureInfo("uk-UA")); - - comboBox1.DisplayMember = "NativeName"; // <= System.Globalization.CultureInfo.GetCultureInfo("ru-RU").NativeName - comboBox1.ValueMember = "Name"; // <= System.Globalization.CultureInfo.GetCultureInfo("ru-RU").Name - - // Если в настройках есть язык, выбираем его в списке. - String _culture = Properties.Settings.Default.Culture; - if (_culture.Equals("Auto")) - comboBox1.SelectedItem = sysLang; - else - { - var qwe = System.Globalization.CultureInfo.GetCultureInfo(_culture); - comboBox1.SelectedItem = qwe; - } - - } - - private void SaveSettings() - { - //Properties.Settings.Default.FontLogMainWindow = textBox1.Font; - //Properties.Settings.Default.FontLogContextMenuWindow = textBox2.Font; - - if (Language.SystemLanguage.Equals(comboBox1.SelectedItem.ToString())) - Properties.Settings.Default.Culture = "Auto"; - else - Properties.Settings.Default.Culture = comboBox1.SelectedItem.ToString(); - Properties.Settings.Default.Save(); - } - - public static void RunAsAdmin(string aFileName, string anArguments) - { - System.Diagnostics.ProcessStartInfo processInfo = new System.Diagnostics.ProcessStartInfo(); - - processInfo.FileName = aFileName; - processInfo.Arguments = anArguments; - processInfo.UseShellExecute = true; - processInfo.Verb = "runas"; // здесь вся соль - - try - { - System.Diagnostics.Process.Start(processInfo); - } - catch (Exception e) - { - MessageBox.Show(e.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - //private void button1_Click(object sender, EventArgs e) - //{ - // FontDialog fontDialog1 = new FontDialog(); - // fontDialog1.Font = textBox1.Font; - // if (fontDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) - // { - // textBox1.Text = fontDialog1.Font.Name + ", " + fontDialog1.Font.Size; - // textBox1.Font = fontDialog1.Font; - // } - //} - - //private void button2_Click(object sender, EventArgs e) - //{ - // FontDialog fontDialog1 = new FontDialog(); - // fontDialog1.Font = textBox2.Font; - // if (fontDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) - // { - // textBox2.Text = fontDialog1.Font.Name + ", " + fontDialog1.Font.Size; - // textBox2.Font = fontDialog1.Font; - // } - //} - - private void buttonCustomJavaLocation_Click(object sender, EventArgs e) - { - using(OpenFileDialog openJavaExe = new OpenFileDialog()) - { - openJavaExe.Filter = "java.exe|java.exe"; - if (openJavaExe.ShowDialog() == System.Windows.Forms.DialogResult.OK) - textBoxCustomJavaLocation.Text = Program.GetPortablePath(openJavaExe.FileName); - } - - //OpenFileDialog openJavaExe = new OpenFileDialog() - //{ - // Multiselect = false, - // Filter = "java.exe|java.exe" - //}; - //if (openJavaExe.ShowDialog() == System.Windows.Forms.DialogResult.OK) - //{ - // textBoxCustomJavaLocation.Text = openJavaExe.FileName; - //} - } - } -} diff --git a/APKToolGUI/FormSettings.resx b/APKToolGUI/FormSettings.resx deleted file mode 100644 index 08d66f4..0000000 --- a/APKToolGUI/FormSettings.resx +++ /dev/null @@ -1,651 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - System - - - Administrator rights required - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 1 - - - groupBoxContextMenu - - - Top, Left, Right - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Right - - - NoControl - - - NoControl - - - NoControl - - - Top, Bottom, Left, Right - - - 0 - - - groupBoxContextMenu - - - tabControl1 - - - Uninstall - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - - 247, 23 - - - MiddleLeft - - - tabPage1 - - - 0 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Cancel - - - Settings - - - Clear log before action - - - NoControl - - - buttonCustomJavaLocation - - - 83, 23 - - - 160, 17 - - - Top, Left, Right - - - comboBox1 - - - 0 - - - 4 - - - 129, 19 - - - groupBoxJava - - - buttonAddContextMenu - - - groupBox1 - - - groupBox1 - - - Top, Left, Right - - - checkBoxCheckUpdateStartup - - - textBoxCustomJavaLocation - - - groupBoxJava - - - 183, 23 - - - 9 - - - 4, 22 - - - groupBoxContextMenu - - - Top, Right - - - labelAdminRights - - - 0 - - - 11 - - - System - - - Context menu - - - 2 - - - 12 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - checkBox1 - - - tabControl1 - - - False - - - 1 - - - buttonCancel - - - 454, 265 - - - tabPage1 - - - Top, Left, Right - - - 5 - - - groupBox1 - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom, Right - - - 0 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 132, 17 - - - 3, 3, 3, 3 - - - 3 - - - NoControl - - - FormSettings - - - Bottom, Right - - - System - - - $this - - - Top, Left, Right - - - 0 - - - 1 - - - 5 - - - 1 - - - 0 - - - groupBoxJava - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage1 - - - CenterParent - - - 405, 17 - - - 345, 21 - - - 385, 278 - - - buttonОК - - - Check for updates at startup - - - groupBoxLanguage - - - $this - - - System - - - ImageBeforeText - - - 2 - - - 256, 21 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Left, Right - - - 6, 168 - - - 2 - - - 6, 115 - - - 3, 21 - - - Language - - - $this - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6, 6 - - - 2 - - - groupBoxContextMenu - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 23, 20 - - - 1 - - - 75, 23 - - - System - - - 304, 278 - - - 9, 19 - - - 446, 239 - - - 2 - - - 0 - - - 299, 21 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Left, Right - - - tabPage1 - - - 6 - - - 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBoxJava - - - System - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Install - - - 9, 42 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - True - - - General - - - 1 - - - Custom Java location - - - 6, 59 - - - Java - - - 6, 13 - - - buttonRemoveContextMenu - - - ... - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 8 - - - 6, 6 - - - NoControl - - - tabPage1 - - - 466, 308 - - - 1 - - - Top, Right - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 434, 65 - - - 209, 20 - - - ОК - - - 75, 23 - - - 83, 23 - - - 1 - - - True - - - labelCustomJavaLocation - - - 6, 17 - - - groupBoxLanguage - - - NoControl - - - 0 - - - 434, 47 - - - NoControl - - - 434, 50 - - - 2 - - - Other - - - 434, 47 - - - MiddleRight - - - 195, 18 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - ru - - \ No newline at end of file diff --git a/APKToolGUI/FormSettings.ru.resx b/APKToolGUI/FormSettings.ru.resx deleted file mode 100644 index 985f2f7..0000000 --- a/APKToolGUI/FormSettings.ru.resx +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 288, 17 - - - Очищать журнал событий перед каждой операцией - - - 276, 17 - - - Проверять обновление при запуске (раз в сутки) - - - Прочее - - - Пользовательское расположение - - - 23, 22 - - - Язык - - - Требуются права администратора - - - Установить - - - Удалить - - - Контекстное меню - - - Общие - - - Отмена - - - Настройки - - \ No newline at end of file diff --git a/APKToolGUI/Forms/AboutWindow.xaml b/APKToolGUI/Forms/AboutWindow.xaml new file mode 100644 index 0000000..8bb749a --- /dev/null +++ b/APKToolGUI/Forms/AboutWindow.xaml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +