Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dddadb5e6 | ||
|
|
3b5fc52e31 | ||
|
|
2152f08bc3 | ||
|
|
e6d2c9604a | ||
|
|
235b378f9f | ||
|
|
39339c2583 | ||
|
|
72e0d4fba4 | ||
|
|
efc1b3b773 | ||
|
|
4dbc236b31 | ||
|
|
730c88316e | ||
|
|
3641a8ec1d | ||
|
|
003ad447a1 | ||
|
|
cb1b2c2e5e | ||
|
|
dbe8df01e0 |
@@ -27,22 +27,50 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>AndroidSideloader.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MetroFramework">
|
||||
<HintPath>..\Fortniteaccgen\packages\MetroModernUI.1.4.0.0\lib\net\MetroFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SergeUtils">
|
||||
<HintPath>.\SergeUtils.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -66,12 +94,19 @@
|
||||
<Compile Include="customAdbCommandForm.Designer.cs">
|
||||
<DependentUpon>customAdbCommandForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FlexibleMessageBox.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SettingsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SettingsForm.Designer.cs">
|
||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="usernameForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -96,6 +131,9 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="SettingsForm.resx">
|
||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="usernameForm.resx">
|
||||
<DependentUpon>usernameForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
@@ -8,13 +8,19 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{CC8BE9F0-CE07-406A-A378-81D9CFE4CC1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
18
App.config
18
App.config
@@ -1,6 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="AndroidSideloader.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<AndroidSideloader.Properties.Settings>
|
||||
<setting name="checkForUpdates" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="enableMessageBoxes" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="copyMessageToClipboard" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</AndroidSideloader.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
79
Changelog.txt
Normal file
79
Changelog.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
0.12
|
||||
+ Added settings form
|
||||
+ Added progress bar (again)
|
||||
+ Added a new user.json
|
||||
= Fixed crash on some systems (PerformanceCounter)
|
||||
= Fixed crash because of file name inconsistency
|
||||
- Removed performance counters because they made the software not work for some people
|
||||
|
||||
0.11
|
||||
+ Changed normal message boxes to flexible ones
|
||||
+ Added changelog to update message
|
||||
= Improved update message
|
||||
- Removed progressbar
|
||||
|
||||
0.10
|
||||
+ Added few tooltips
|
||||
+ Sideload folder now works for all apks (recursive search)
|
||||
= Obb copy and Sideload progress bar problems should be fixed
|
||||
= Fixed user.json not working if the any of folder had spaces
|
||||
= Switched back to Message Boxes
|
||||
|
||||
0.9
|
||||
+ Added the buggy progress bar back, uses different "logic"
|
||||
+ Added an icon (Increased the exe size by like 300% just with that)
|
||||
+ Added sideload folder button
|
||||
+ Added Creat user.json button and form
|
||||
+ Changed Message Boxes to notifications
|
||||
|
||||
0.8.5
|
||||
+ Added auto update download
|
||||
= Fixed a bug where if you didn't have the adb folder it would crash
|
||||
|
||||
0.8
|
||||
+ Every command now shows progress on title bar
|
||||
+ Automatically run Adb Devices and List Apps on form startup
|
||||
+ You can now search the App List Combo Box
|
||||
= Cleaned some code
|
||||
|
||||
0.7
|
||||
= Fixed UI Freezes
|
||||
+ Added Uninstall APK Button
|
||||
+ Added Launch package Button
|
||||
- Removed loading bar
|
||||
|
||||
0.6
|
||||
+ Added List Apk Perms button
|
||||
+ Added Change Permissions button
|
||||
+ Added dinamically added checkbox for permisssions
|
||||
= The software now downloads adb from master instead of v0.3 release
|
||||
|
||||
0.5
|
||||
- Removed Flash Firmware
|
||||
= Redesigned UI
|
||||
= Reworked RunAdbCommand function (now it will be possible to do stuff I wasnt able to do before)
|
||||
= Replaced Ui Buttons, still needs work
|
||||
+ Added List apk button
|
||||
+ Added List apk combo box
|
||||
+ Added get apk function
|
||||
= Cleaned a bit of code
|
||||
|
||||
0.4
|
||||
+ Added auto download of adb archive
|
||||
+ Added auto extraction of adb archive
|
||||
|
||||
0.3
|
||||
+ Added new form, you can run custom adb commands now
|
||||
+ Added recover and backup app data
|
||||
- Removed Select APK and Select OBB Buttons
|
||||
- Removed tooltips from removed buttons
|
||||
+ Sideload APK and Copy Obb buttons now also make you select the file/folder
|
||||
+ Improved firmware button
|
||||
|
||||
0.2
|
||||
+ Added Flash Firmware button
|
||||
+ Added few tooltips
|
||||
+ Renamed buttons
|
||||
|
||||
0.1
|
||||
+ Initial Release
|
||||
862
FlexibleMessageBox.cs
Normal file
862
FlexibleMessageBox.cs
Normal file
@@ -0,0 +1,862 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JR.Utils.GUI.Forms
|
||||
{
|
||||
/* FlexibleMessageBox – A flexible replacement for the .NET MessageBox
|
||||
*
|
||||
* Author: Jörg Reichert (public@jreichert.de)
|
||||
* Contributors: Thanks to: David Hall, Roink
|
||||
* Version: 1.3
|
||||
* Published at: http://www.codeproject.com/Articles/601900/FlexibleMessageBox
|
||||
*
|
||||
************************************************************************************************************
|
||||
* Features:
|
||||
* - It can be simply used instead of MessageBox since all important static "Show"-Functions are supported
|
||||
* - It is small, only one source file, which could be added easily to each solution
|
||||
* - It can be resized and the content is correctly word-wrapped
|
||||
* - It tries to auto-size the width to show the longest text row
|
||||
* - It never exceeds the current desktop working area
|
||||
* - It displays a vertical scrollbar when needed
|
||||
* - It does support hyperlinks in text
|
||||
*
|
||||
* Because the interface is identical to MessageBox, you can add this single source file to your project
|
||||
* and use the FlexibleMessageBox almost everywhere you use a standard MessageBox.
|
||||
* The goal was NOT to produce as many features as possible but to provide a simple replacement to fit my
|
||||
* own needs. Feel free to add additional features on your own, but please left my credits in this class.
|
||||
*
|
||||
************************************************************************************************************
|
||||
* Usage examples:
|
||||
*
|
||||
* FlexibleMessageBox.Show("Just a text");
|
||||
*
|
||||
* FlexibleMessageBox.Show("A text",
|
||||
* "A caption");
|
||||
*
|
||||
* FlexibleMessageBox.Show("Some text with a link: www.google.com",
|
||||
* "Some caption",
|
||||
* MessageBoxButtons.AbortRetryIgnore,
|
||||
* MessageBoxIcon.Information,
|
||||
* MessageBoxDefaultButton.Button2);
|
||||
*
|
||||
* var dialogResult = FlexibleMessageBox.Show("Do you know the answer to life the universe and everything?",
|
||||
* "One short question",
|
||||
* MessageBoxButtons.YesNo);
|
||||
*
|
||||
************************************************************************************************************
|
||||
* THE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS", WITHOUT WARRANTY
|
||||
* OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THIS
|
||||
* SOFTWARE.
|
||||
*
|
||||
************************************************************************************************************
|
||||
* History:
|
||||
* Version 1.3 - 19.Dezember 2014
|
||||
* - Added refactoring function GetButtonText()
|
||||
* - Used CurrentUICulture instead of InstalledUICulture
|
||||
* - Added more button localizations. Supported languages are now: ENGLISH, GERMAN, SPANISH, ITALIAN
|
||||
* - Added standard MessageBox handling for "copy to clipboard" with <Ctrl> + <C> and <Ctrl> + <Insert>
|
||||
* - Tab handling is now corrected (only tabbing over the visible buttons)
|
||||
* - Added standard MessageBox handling for ALT-Keyboard shortcuts
|
||||
* - SetDialogSizes: Refactored completely: Corrected sizing and added caption driven sizing
|
||||
*
|
||||
* Version 1.2 - 10.August 2013
|
||||
* - Do not ShowInTaskbar anymore (original MessageBox is also hidden in taskbar)
|
||||
* - Added handling for Escape-Button
|
||||
* - Adapted top right close button (red X) to behave like MessageBox (but hidden instead of deactivated)
|
||||
*
|
||||
* Version 1.1 - 14.June 2013
|
||||
* - Some Refactoring
|
||||
* - Added internal form class
|
||||
* - Added missing code comments, etc.
|
||||
*
|
||||
* Version 1.0 - 15.April 2013
|
||||
* - Initial Version
|
||||
*/
|
||||
public class FlexibleMessageBox
|
||||
{
|
||||
#region Public statics
|
||||
|
||||
/// <summary>
|
||||
/// Defines the maximum width for all FlexibleMessageBox instances in percent of the working area.
|
||||
///
|
||||
/// Allowed values are 0.2 - 1.0 where:
|
||||
/// 0.2 means: The FlexibleMessageBox can be at most half as wide as the working area.
|
||||
/// 1.0 means: The FlexibleMessageBox can be as wide as the working area.
|
||||
///
|
||||
/// Default is: 70% of the working area width.
|
||||
/// </summary>
|
||||
public static double MAX_WIDTH_FACTOR = 0.7;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the maximum height for all FlexibleMessageBox instances in percent of the working area.
|
||||
///
|
||||
/// Allowed values are 0.2 - 1.0 where:
|
||||
/// 0.2 means: The FlexibleMessageBox can be at most half as high as the working area.
|
||||
/// 1.0 means: The FlexibleMessageBox can be as high as the working area.
|
||||
///
|
||||
/// Default is: 90% of the working area height.
|
||||
/// </summary>
|
||||
public static double MAX_HEIGHT_FACTOR = 0.9;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the font for all FlexibleMessageBox instances.
|
||||
///
|
||||
/// Default is: SystemFonts.MessageBoxFont
|
||||
/// </summary>
|
||||
public static Font FONT = SystemFonts.MessageBoxFont;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public show functions
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns></returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal form class
|
||||
|
||||
/// <summary>
|
||||
/// The form to show the customized message box.
|
||||
/// It is defined as an internal class to keep the public interface of the FlexibleMessageBox clean.
|
||||
/// </summary>
|
||||
class FlexibleMessageBoxForm : Form
|
||||
{
|
||||
#region Form-Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.richTextBoxMessage = new System.Windows.Forms.RichTextBox();
|
||||
this.FlexibleMessageBoxFormBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.pictureBoxForIcon = new System.Windows.Forms.PictureBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.FlexibleMessageBoxFormBindingSource)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxForIcon)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.AutoSize = true;
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button1.Location = new System.Drawing.Point(11, 67);
|
||||
this.button1.MinimumSize = new System.Drawing.Size(0, 24);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 24);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "OK";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Visible = false;
|
||||
//
|
||||
// richTextBoxMessage
|
||||
//
|
||||
this.richTextBoxMessage.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.richTextBoxMessage.BackColor = System.Drawing.Color.White;
|
||||
this.richTextBoxMessage.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.richTextBoxMessage.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlexibleMessageBoxFormBindingSource, "MessageText", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.richTextBoxMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.richTextBoxMessage.Location = new System.Drawing.Point(50, 26);
|
||||
this.richTextBoxMessage.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.richTextBoxMessage.Name = "richTextBoxMessage";
|
||||
this.richTextBoxMessage.ReadOnly = true;
|
||||
this.richTextBoxMessage.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
|
||||
this.richTextBoxMessage.Size = new System.Drawing.Size(200, 20);
|
||||
this.richTextBoxMessage.TabIndex = 0;
|
||||
this.richTextBoxMessage.TabStop = false;
|
||||
this.richTextBoxMessage.Text = "<Message>";
|
||||
this.richTextBoxMessage.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBoxMessage_LinkClicked);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.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.panel1.BackColor = System.Drawing.Color.White;
|
||||
this.panel1.Controls.Add(this.pictureBoxForIcon);
|
||||
this.panel1.Controls.Add(this.richTextBoxMessage);
|
||||
this.panel1.Location = new System.Drawing.Point(-3, -4);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(268, 59);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// pictureBoxForIcon
|
||||
//
|
||||
this.pictureBoxForIcon.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pictureBoxForIcon.Location = new System.Drawing.Point(15, 19);
|
||||
this.pictureBoxForIcon.Name = "pictureBoxForIcon";
|
||||
this.pictureBoxForIcon.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBoxForIcon.TabIndex = 8;
|
||||
this.pictureBoxForIcon.TabStop = false;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button2.Location = new System.Drawing.Point(92, 67);
|
||||
this.button2.MinimumSize = new System.Drawing.Size(0, 24);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 24);
|
||||
this.button2.TabIndex = 3;
|
||||
this.button2.Text = "OK";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Visible = false;
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button3.AutoSize = true;
|
||||
this.button3.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button3.Location = new System.Drawing.Point(173, 67);
|
||||
this.button3.MinimumSize = new System.Drawing.Size(0, 24);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 24);
|
||||
this.button3.TabIndex = 0;
|
||||
this.button3.Text = "OK";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Visible = false;
|
||||
//
|
||||
// FlexibleMessageBoxForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(260, 102);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.button1);
|
||||
this.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.FlexibleMessageBoxFormBindingSource, "CaptionText", true));
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(276, 140);
|
||||
this.Name = "FlexibleMessageBoxForm";
|
||||
this.ShowIcon = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "<Caption>";
|
||||
this.Shown += new System.EventHandler(this.FlexibleMessageBoxForm_Shown);
|
||||
((System.ComponentModel.ISupportInitialize)(this.FlexibleMessageBoxFormBindingSource)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxForIcon)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.BindingSource FlexibleMessageBoxFormBindingSource;
|
||||
private System.Windows.Forms.RichTextBox richTextBoxMessage;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.PictureBox pictureBoxForIcon;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private constants
|
||||
|
||||
//These separators are used for the "copy to clipboard" standard operation, triggered by Ctrl + C (behavior and clipboard format is like in a standard MessageBox)
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||
|
||||
//These are the possible buttons (in a standard MessageBox)
|
||||
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE };
|
||||
|
||||
//These are the buttons texts for different languages.
|
||||
//If you want to add a new language, add it here and in the GetButtonText-Function
|
||||
private enum TwoLetterISOLanguageID { en, de, es, it };
|
||||
private static readonly String[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore" }; //Note: This is also the fallback language
|
||||
private static readonly String[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren" };
|
||||
private static readonly String[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar" };
|
||||
private static readonly String[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora" };
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private members
|
||||
|
||||
private MessageBoxDefaultButton defaultButton;
|
||||
private int visibleButtonsCount;
|
||||
private TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FlexibleMessageBoxForm"/> class.
|
||||
/// </summary>
|
||||
private FlexibleMessageBoxForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//Try to evaluate the language. If this fails, the fallback language English will be used
|
||||
Enum.TryParse<TwoLetterISOLanguageID>(CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, out this.languageID);
|
||||
|
||||
this.KeyPreview = true;
|
||||
this.KeyUp += FlexibleMessageBoxForm_KeyUp;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private helper functions
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string rows.
|
||||
/// </summary>
|
||||
/// <param name="message">The message.</param>
|
||||
/// <returns>The string rows as 1-dimensional array</returns>
|
||||
private static string[] GetStringRows(string message)
|
||||
{
|
||||
if (string.IsNullOrEmpty(message)) return null;
|
||||
|
||||
var messageRows = message.Split(new char[] { '\n' }, StringSplitOptions.None);
|
||||
return messageRows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the button text for the CurrentUICulture language.
|
||||
/// Note: The fallback language is English
|
||||
/// </summary>
|
||||
/// <param name="buttonID">The ID of the button.</param>
|
||||
/// <returns>The button text</returns>
|
||||
private string GetButtonText(ButtonID buttonID)
|
||||
{
|
||||
var buttonTextArrayIndex = Convert.ToInt32(buttonID);
|
||||
|
||||
switch (this.languageID)
|
||||
{
|
||||
case TwoLetterISOLanguageID.de: return BUTTON_TEXTS_GERMAN_DE[buttonTextArrayIndex];
|
||||
case TwoLetterISOLanguageID.es: return BUTTON_TEXTS_SPANISH_ES[buttonTextArrayIndex];
|
||||
case TwoLetterISOLanguageID.it: return BUTTON_TEXTS_ITALIAN_IT[buttonTextArrayIndex];
|
||||
|
||||
default: return BUTTON_TEXTS_ENGLISH_EN[buttonTextArrayIndex];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the given working area factor in the range of 0.2 - 1.0 where:
|
||||
///
|
||||
/// 0.2 means: 20 percent of the working area height or width.
|
||||
/// 1.0 means: 100 percent of the working area height or width.
|
||||
/// </summary>
|
||||
/// <param name="workingAreaFactor">The given working area factor.</param>
|
||||
/// <returns>The corrected given working area factor.</returns>
|
||||
private static double GetCorrectedWorkingAreaFactor(double workingAreaFactor)
|
||||
{
|
||||
const double MIN_FACTOR = 0.2;
|
||||
const double MAX_FACTOR = 1.0;
|
||||
|
||||
if (workingAreaFactor < MIN_FACTOR) return MIN_FACTOR;
|
||||
if (workingAreaFactor > MAX_FACTOR) return MAX_FACTOR;
|
||||
|
||||
return workingAreaFactor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the dialogs start position when given.
|
||||
/// Otherwise center the dialog on the current screen.
|
||||
/// </summary>
|
||||
/// <param name="flexibleMessageBoxForm">The FlexibleMessageBox dialog.</param>
|
||||
/// <param name="owner">The owner.</param>
|
||||
private static void SetDialogStartPosition(FlexibleMessageBoxForm flexibleMessageBoxForm, IWin32Window owner)
|
||||
{
|
||||
//If no owner given: Center on current screen
|
||||
if (owner == null)
|
||||
{
|
||||
var screen = Screen.FromPoint(Cursor.Position);
|
||||
flexibleMessageBoxForm.StartPosition = FormStartPosition.Manual;
|
||||
flexibleMessageBoxForm.Left = screen.Bounds.Left + screen.Bounds.Width / 2 - flexibleMessageBoxForm.Width / 2;
|
||||
flexibleMessageBoxForm.Top = screen.Bounds.Top + screen.Bounds.Height / 2 - flexibleMessageBoxForm.Height / 2;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the dialogs start size (Try to auto-size width to show longest text row).
|
||||
/// Also set the maximum dialog size.
|
||||
/// </summary>
|
||||
/// <param name="flexibleMessageBoxForm">The FlexibleMessageBox dialog.</param>
|
||||
/// <param name="text">The text (the longest text row is used to calculate the dialog width).</param>
|
||||
/// <param name="text">The caption (this can also affect the dialog width).</param>
|
||||
private static void SetDialogSizes(FlexibleMessageBoxForm flexibleMessageBoxForm, string text, string caption)
|
||||
{
|
||||
//First set the bounds for the maximum dialog size
|
||||
flexibleMessageBoxForm.MaximumSize = new Size(Convert.ToInt32(SystemInformation.WorkingArea.Width * FlexibleMessageBoxForm.GetCorrectedWorkingAreaFactor(MAX_WIDTH_FACTOR)),
|
||||
Convert.ToInt32(SystemInformation.WorkingArea.Height * FlexibleMessageBoxForm.GetCorrectedWorkingAreaFactor(MAX_HEIGHT_FACTOR)));
|
||||
|
||||
//Get rows. Exit if there are no rows to render...
|
||||
var stringRows = GetStringRows(text);
|
||||
if (stringRows == null) return;
|
||||
|
||||
//Calculate whole text height
|
||||
var textHeight = TextRenderer.MeasureText(text, FONT).Height;
|
||||
|
||||
//Calculate width for longest text line
|
||||
const int SCROLLBAR_WIDTH_OFFSET = 15;
|
||||
var longestTextRowWidth = stringRows.Max(textForRow => TextRenderer.MeasureText(textForRow, FONT).Width);
|
||||
var captionWidth = TextRenderer.MeasureText(caption, SystemFonts.CaptionFont).Width;
|
||||
var textWidth = Math.Max(longestTextRowWidth + SCROLLBAR_WIDTH_OFFSET, captionWidth);
|
||||
|
||||
//Calculate margins
|
||||
var marginWidth = flexibleMessageBoxForm.Width - flexibleMessageBoxForm.richTextBoxMessage.Width;
|
||||
var marginHeight = flexibleMessageBoxForm.Height - flexibleMessageBoxForm.richTextBoxMessage.Height;
|
||||
|
||||
//Set calculated dialog size (if the calculated values exceed the maximums, they were cut by windows forms automatically)
|
||||
flexibleMessageBoxForm.Size = new Size(textWidth + marginWidth,
|
||||
textHeight + marginHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the dialogs icon.
|
||||
/// When no icon is used: Correct placement and width of rich text box.
|
||||
/// </summary>
|
||||
/// <param name="flexibleMessageBoxForm">The FlexibleMessageBox dialog.</param>
|
||||
/// <param name="icon">The MessageBoxIcon.</param>
|
||||
private static void SetDialogIcon(FlexibleMessageBoxForm flexibleMessageBoxForm, MessageBoxIcon icon)
|
||||
{
|
||||
switch (icon)
|
||||
{
|
||||
case MessageBoxIcon.Information:
|
||||
flexibleMessageBoxForm.pictureBoxForIcon.Image = SystemIcons.Information.ToBitmap();
|
||||
break;
|
||||
case MessageBoxIcon.Warning:
|
||||
flexibleMessageBoxForm.pictureBoxForIcon.Image = SystemIcons.Warning.ToBitmap();
|
||||
break;
|
||||
case MessageBoxIcon.Error:
|
||||
flexibleMessageBoxForm.pictureBoxForIcon.Image = SystemIcons.Error.ToBitmap();
|
||||
break;
|
||||
case MessageBoxIcon.Question:
|
||||
flexibleMessageBoxForm.pictureBoxForIcon.Image = SystemIcons.Question.ToBitmap();
|
||||
break;
|
||||
default:
|
||||
//When no icon is used: Correct placement and width of rich text box.
|
||||
flexibleMessageBoxForm.pictureBoxForIcon.Visible = false;
|
||||
flexibleMessageBoxForm.richTextBoxMessage.Left -= flexibleMessageBoxForm.pictureBoxForIcon.Width;
|
||||
flexibleMessageBoxForm.richTextBoxMessage.Width += flexibleMessageBoxForm.pictureBoxForIcon.Width;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set dialog buttons visibilities and texts.
|
||||
/// Also set a default button.
|
||||
/// </summary>
|
||||
/// <param name="flexibleMessageBoxForm">The FlexibleMessageBox dialog.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
private static void SetDialogButtons(FlexibleMessageBoxForm flexibleMessageBoxForm, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
//Set the buttons visibilities and texts
|
||||
switch (buttons)
|
||||
{
|
||||
case MessageBoxButtons.AbortRetryIgnore:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 3;
|
||||
|
||||
flexibleMessageBoxForm.button1.Visible = true;
|
||||
flexibleMessageBoxForm.button1.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.ABORT);
|
||||
flexibleMessageBoxForm.button1.DialogResult = DialogResult.Abort;
|
||||
|
||||
flexibleMessageBoxForm.button2.Visible = true;
|
||||
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.RETRY);
|
||||
flexibleMessageBoxForm.button2.DialogResult = DialogResult.Retry;
|
||||
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.IGNORE);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.Ignore;
|
||||
|
||||
flexibleMessageBoxForm.ControlBox = false;
|
||||
break;
|
||||
|
||||
case MessageBoxButtons.OKCancel:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 2;
|
||||
|
||||
flexibleMessageBoxForm.button2.Visible = true;
|
||||
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.OK);
|
||||
flexibleMessageBoxForm.button2.DialogResult = DialogResult.OK;
|
||||
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.CANCEL);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;
|
||||
|
||||
flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
|
||||
break;
|
||||
|
||||
case MessageBoxButtons.RetryCancel:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 2;
|
||||
|
||||
flexibleMessageBoxForm.button2.Visible = true;
|
||||
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.RETRY);
|
||||
flexibleMessageBoxForm.button2.DialogResult = DialogResult.Retry;
|
||||
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.CANCEL);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;
|
||||
|
||||
flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
|
||||
break;
|
||||
|
||||
case MessageBoxButtons.YesNo:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 2;
|
||||
|
||||
flexibleMessageBoxForm.button2.Visible = true;
|
||||
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.YES);
|
||||
flexibleMessageBoxForm.button2.DialogResult = DialogResult.Yes;
|
||||
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.NO);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.No;
|
||||
|
||||
flexibleMessageBoxForm.ControlBox = false;
|
||||
break;
|
||||
|
||||
case MessageBoxButtons.YesNoCancel:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 3;
|
||||
|
||||
flexibleMessageBoxForm.button1.Visible = true;
|
||||
flexibleMessageBoxForm.button1.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.YES);
|
||||
flexibleMessageBoxForm.button1.DialogResult = DialogResult.Yes;
|
||||
|
||||
flexibleMessageBoxForm.button2.Visible = true;
|
||||
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.NO);
|
||||
flexibleMessageBoxForm.button2.DialogResult = DialogResult.No;
|
||||
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.CANCEL);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;
|
||||
|
||||
flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
|
||||
break;
|
||||
|
||||
case MessageBoxButtons.OK:
|
||||
default:
|
||||
flexibleMessageBoxForm.visibleButtonsCount = 1;
|
||||
flexibleMessageBoxForm.button3.Visible = true;
|
||||
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.OK);
|
||||
flexibleMessageBoxForm.button3.DialogResult = DialogResult.OK;
|
||||
|
||||
flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
|
||||
break;
|
||||
}
|
||||
|
||||
//Set default button (used in FlexibleMessageBoxForm_Shown)
|
||||
flexibleMessageBoxForm.defaultButton = defaultButton;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private event handlers
|
||||
|
||||
/// <summary>
|
||||
/// Handles the Shown event of the FlexibleMessageBoxForm control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
int buttonIndexToFocus = 1;
|
||||
Button buttonToFocus;
|
||||
|
||||
//Set the default button...
|
||||
switch (this.defaultButton)
|
||||
{
|
||||
case MessageBoxDefaultButton.Button1:
|
||||
default:
|
||||
buttonIndexToFocus = 1;
|
||||
break;
|
||||
case MessageBoxDefaultButton.Button2:
|
||||
buttonIndexToFocus = 2;
|
||||
break;
|
||||
case MessageBoxDefaultButton.Button3:
|
||||
buttonIndexToFocus = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
if (buttonIndexToFocus > this.visibleButtonsCount) buttonIndexToFocus = this.visibleButtonsCount;
|
||||
|
||||
if (buttonIndexToFocus == 3)
|
||||
{
|
||||
buttonToFocus = this.button3;
|
||||
}
|
||||
else if (buttonIndexToFocus == 2)
|
||||
{
|
||||
buttonToFocus = this.button2;
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonToFocus = this.button1;
|
||||
}
|
||||
|
||||
buttonToFocus.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the LinkClicked event of the richTextBoxMessage control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.LinkClickedEventArgs"/> instance containing the event data.</param>
|
||||
private void richTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
Process.Start(e.LinkText);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Let the caller of FlexibleMessageBoxForm decide what to do with this exception...
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the KeyUp event of the richTextBoxMessage control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.KeyEventArgs"/> instance containing the event data.</param>
|
||||
void FlexibleMessageBoxForm_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
//Handle standard key strikes for clipboard copy: "Ctrl + C" and "Ctrl + Insert"
|
||||
if (e.Control && (e.KeyCode == Keys.C || e.KeyCode == Keys.Insert))
|
||||
{
|
||||
var buttonsTextLine = (this.button1.Visible ? this.button1.Text + STANDARD_MESSAGEBOX_SEPARATOR_SPACES : string.Empty)
|
||||
+ (this.button2.Visible ? this.button2.Text + STANDARD_MESSAGEBOX_SEPARATOR_SPACES : string.Empty)
|
||||
+ (this.button3.Visible ? this.button3.Text + STANDARD_MESSAGEBOX_SEPARATOR_SPACES : string.Empty);
|
||||
|
||||
//Build same clipboard text like the standard .Net MessageBox
|
||||
var textForClipboard = STANDARD_MESSAGEBOX_SEPARATOR_LINES
|
||||
+ this.Text + Environment.NewLine
|
||||
+ STANDARD_MESSAGEBOX_SEPARATOR_LINES
|
||||
+ this.richTextBoxMessage.Text + Environment.NewLine
|
||||
+ STANDARD_MESSAGEBOX_SEPARATOR_LINES
|
||||
+ buttonsTextLine.Replace("&", string.Empty) + Environment.NewLine
|
||||
+ STANDARD_MESSAGEBOX_SEPARATOR_LINES;
|
||||
|
||||
//Set text in clipboard
|
||||
Clipboard.SetText(textForClipboard);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties (only used for binding)
|
||||
|
||||
/// <summary>
|
||||
/// The text that is been used for the heading.
|
||||
/// </summary>
|
||||
public string CaptionText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The text that is been used in the FlexibleMessageBoxForm.
|
||||
/// </summary>
|
||||
public string MessageText { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public show function
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
//Create a new instance of the FlexibleMessageBox form
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
||||
|
||||
//Bind the caption and the message text
|
||||
flexibleMessageBoxForm.CaptionText = caption;
|
||||
flexibleMessageBoxForm.MessageText = text;
|
||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||
|
||||
//Set the buttons visibilities and texts. Also set a default button.
|
||||
SetDialogButtons(flexibleMessageBoxForm, buttons, defaultButton);
|
||||
|
||||
//Set the dialogs icon. When no icon is used: Correct placement and width of rich text box.
|
||||
SetDialogIcon(flexibleMessageBoxForm, icon);
|
||||
|
||||
//Set the font for all controls
|
||||
flexibleMessageBoxForm.Font = FONT;
|
||||
flexibleMessageBoxForm.richTextBoxMessage.Font = FONT;
|
||||
|
||||
//Calculate the dialogs start size (Try to auto-size width to show longest text row). Also set the maximum dialog size.
|
||||
SetDialogSizes(flexibleMessageBoxForm, text, caption);
|
||||
|
||||
//Set the dialogs start position when given. Otherwise center the dialog on the current screen.
|
||||
SetDialogStartPosition(flexibleMessageBoxForm, owner);
|
||||
|
||||
//Show the dialog
|
||||
return flexibleMessageBoxForm.ShowDialog(owner);
|
||||
}
|
||||
|
||||
#endregion
|
||||
} //class FlexibleMessageBoxForm
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
59
Form1.Designer.cs
generated
59
Form1.Designer.cs
generated
@@ -46,10 +46,9 @@
|
||||
this.uninstallAppButton = new System.Windows.Forms.Button();
|
||||
this.sideloadFolderButton = new System.Windows.Forms.Button();
|
||||
this.aboutBtn = new System.Windows.Forms.Button();
|
||||
this.label = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.userjsonButton = new System.Windows.Forms.Button();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.settingsButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// m_combo
|
||||
@@ -217,33 +216,6 @@
|
||||
this.aboutBtn.UseVisualStyleBackColor = true;
|
||||
this.aboutBtn.Click += new System.EventHandler(this.aboutBtn_Click);
|
||||
//
|
||||
// label
|
||||
//
|
||||
this.label.AutoSize = true;
|
||||
this.label.Location = new System.Drawing.Point(27, 363);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(35, 13);
|
||||
this.label.TabIndex = 19;
|
||||
this.label.Text = "label1";
|
||||
this.label.Visible = false;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(27, 389);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(35, 13);
|
||||
this.label1.TabIndex = 20;
|
||||
this.label1.Text = "label1";
|
||||
this.label1.Visible = false;
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.Location = new System.Drawing.Point(12, 157);
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.Size = new System.Drawing.Size(427, 23);
|
||||
this.progressBar.TabIndex = 21;
|
||||
//
|
||||
// userjsonButton
|
||||
//
|
||||
this.userjsonButton.Location = new System.Drawing.Point(473, 13);
|
||||
@@ -254,15 +226,31 @@
|
||||
this.userjsonButton.UseVisualStyleBackColor = true;
|
||||
this.userjsonButton.Click += new System.EventHandler(this.userjsonButton_Click);
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(12, 161);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(428, 20);
|
||||
this.progressBar1.TabIndex = 23;
|
||||
//
|
||||
// settingsButton
|
||||
//
|
||||
this.settingsButton.Location = new System.Drawing.Point(504, 94);
|
||||
this.settingsButton.Name = "settingsButton";
|
||||
this.settingsButton.Size = new System.Drawing.Size(64, 34);
|
||||
this.settingsButton.TabIndex = 24;
|
||||
this.settingsButton.Text = "Settings";
|
||||
this.settingsButton.UseVisualStyleBackColor = true;
|
||||
this.settingsButton.Click += new System.EventHandler(this.settingsButton_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(650, 411);
|
||||
this.Controls.Add(this.settingsButton);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.userjsonButton);
|
||||
this.Controls.Add(this.progressBar);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.label);
|
||||
this.Controls.Add(this.aboutBtn);
|
||||
this.Controls.Add(this.sideloadFolderButton);
|
||||
this.Controls.Add(this.uninstallAppButton);
|
||||
@@ -310,10 +298,9 @@
|
||||
private System.Windows.Forms.Button uninstallAppButton;
|
||||
private System.Windows.Forms.Button sideloadFolderButton;
|
||||
private System.Windows.Forms.Button aboutBtn;
|
||||
private System.Windows.Forms.Label label;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ProgressBar progressBar;
|
||||
private System.Windows.Forms.Button userjsonButton;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Button settingsButton;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
164
Form1.cs
164
Form1.cs
@@ -11,6 +11,7 @@ using System.Reflection;
|
||||
using System.Windows.Threading;
|
||||
using System.Net;
|
||||
using SergeUtils;
|
||||
using JR.Utils.GUI.Forms;
|
||||
|
||||
|
||||
/* <a target="_blank" href="https://icons8.com/icons/set/van">Van icon</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>
|
||||
@@ -20,18 +21,16 @@ using SergeUtils;
|
||||
namespace AndroidSideloader
|
||||
{
|
||||
|
||||
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
#if DEBUG
|
||||
bool debugMode = true;
|
||||
public static bool debugMode = true;
|
||||
#else
|
||||
bool debugMode = false;
|
||||
public static bool debugMode = false;
|
||||
#endif
|
||||
string path;
|
||||
string obbPath = "";
|
||||
string obbFile;
|
||||
int size;
|
||||
string allText;
|
||||
|
||||
bool exit = false;
|
||||
@@ -58,11 +57,11 @@ namespace AndroidSideloader
|
||||
|
||||
public void runAdbCommand(string command)
|
||||
{
|
||||
|
||||
string oldTitle = this.Text;
|
||||
changeTitle("Rookie's Sideloader | Running command " + command);
|
||||
|
||||
exit = false;
|
||||
|
||||
Process cmd = new Process();
|
||||
cmd.StartInfo.FileName = Environment.CurrentDirectory + "\\adb\\adb.exe";
|
||||
cmd.StartInfo.Arguments = command;
|
||||
@@ -101,7 +100,6 @@ namespace AndroidSideloader
|
||||
t1.Start();
|
||||
t1.Join();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private async void startsideloadbutton_Click(object sender, EventArgs e)
|
||||
@@ -117,15 +115,11 @@ namespace AndroidSideloader
|
||||
else
|
||||
return;
|
||||
}
|
||||
progressBar.Value = 0;
|
||||
FileInfo fi = new FileInfo(path);
|
||||
size = (int)fi.Length / 1024;
|
||||
progressBar.Maximum = size;
|
||||
|
||||
Task.Delay(100).ContinueWith(t => Timer99.Start()); //Delete notification after 5 seconds
|
||||
//Task.Delay(100).ContinueWith(t => Timer99.Start()); //Delete notification after 5 seconds
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
await Task.Run(() => sideload(path));
|
||||
Timer99.Stop();
|
||||
progressBar.Value = size;
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
|
||||
notify(allText);
|
||||
|
||||
@@ -142,17 +136,13 @@ namespace AndroidSideloader
|
||||
|
||||
public static void notify(string message)
|
||||
{
|
||||
var notifyIcon = new System.Windows.Forms.NotifyIcon();
|
||||
//notifyIcon.Icon = System.Drawing.SystemIcons.Application;
|
||||
notifyIcon.Icon = System.Drawing.SystemIcons.Asterisk;
|
||||
notifyIcon.BalloonTipTitle = "AndroidSideloader";
|
||||
notifyIcon.BalloonTipText = message;
|
||||
notifyIcon.Visible = true;
|
||||
notifyIcon.BalloonTipClicked += (sender, e) => {
|
||||
Clipboard.SetText(message);
|
||||
};
|
||||
notifyIcon.ShowBalloonTip(3000);
|
||||
Task.Delay(5000).ContinueWith(t => notifyIcon.Dispose()); //Delete notification after 5 seconds
|
||||
if (Properties.Settings.Default.enableMessageBoxes == true)
|
||||
{
|
||||
FlexibleMessageBox.Show(message);
|
||||
if (Properties.Settings.Default.copyMessageToClipboard == true)
|
||||
Clipboard.SetText(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void instructionsbutton_Click(object sender, EventArgs e)
|
||||
@@ -163,7 +153,7 @@ namespace AndroidSideloader
|
||||
4. Select your apk with select apk button.
|
||||
5. Press Sideload and wait...
|
||||
6. If the game has an obb folder, select it by using select obb then press copy obb";
|
||||
MessageBox.Show(instructions);
|
||||
FlexibleMessageBox.Show(instructions);
|
||||
}
|
||||
|
||||
public void ExtractFile(string sourceArchive, string destination)
|
||||
@@ -202,15 +192,10 @@ namespace AndroidSideloader
|
||||
}
|
||||
else return;
|
||||
|
||||
progressBar.Value = 0;
|
||||
FileInfo fi = new FileInfo(obbFile);
|
||||
size = (int)fi.Length / 1024;
|
||||
progressBar.Maximum = size;
|
||||
|
||||
Task.Delay(100).ContinueWith(t => Timer99.Start()); //Delete notification after 5 seconds
|
||||
//Task.Delay(100).ContinueWith(t => Timer99.Start()); //Delete notification after 5 seconds
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
await Task.Run(() => obbcopy(obbPath));
|
||||
Timer99.Stop();
|
||||
progressBar.Value = size;
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
|
||||
notify(allText);
|
||||
}
|
||||
@@ -223,18 +208,16 @@ namespace AndroidSideloader
|
||||
this.Text = "Rookie Sideloader | No Device Connected";
|
||||
}
|
||||
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (debugMode==true)
|
||||
{
|
||||
label.Visible = true;
|
||||
label1.Visible = true;
|
||||
}
|
||||
this.CenterToScreen();
|
||||
|
||||
if (File.Exists(debugPath))
|
||||
File.Delete(debugPath);
|
||||
if (Directory.Exists(adbPath)==false)
|
||||
{
|
||||
MessageBox.Show("Please wait for the software to download and install the adb");
|
||||
FlexibleMessageBox.Show("Please wait for the software to download and install the adb");
|
||||
try
|
||||
{
|
||||
using (var client = new WebClient())
|
||||
@@ -252,7 +235,7 @@ namespace AndroidSideloader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Cannot download adb because you are not connected to the internet!");
|
||||
FlexibleMessageBox.Show("Cannot download adb because you are not connected to the internet!");
|
||||
StreamWriter sw = File.AppendText(debugPath);
|
||||
sw.Write("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
|
||||
sw.Write(ex.ToString() + "\n");
|
||||
@@ -262,11 +245,14 @@ namespace AndroidSideloader
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
runAdbCommand("devices");
|
||||
changeTitlebarToDevice();
|
||||
|
||||
if (debugMode==false)
|
||||
checkForUpdate();
|
||||
if (Properties.Settings.Default.checkForUpdates==true)
|
||||
checkForUpdate();
|
||||
|
||||
intToolTips();
|
||||
|
||||
listappsBtn();
|
||||
@@ -292,26 +278,37 @@ namespace AndroidSideloader
|
||||
ListAppPermsToolTip.SetToolTip(this.listApkPermsButton, "Lists the permissions for the selected apk");
|
||||
ToolTip ChangeAppPermsToolTip = new ToolTip();
|
||||
ChangeAppPermsToolTip.SetToolTip(this.changePermsBtn, "Applies the permissions for the apk, first press list app perms");
|
||||
ToolTip sideloadFolderToolTip = new ToolTip();
|
||||
sideloadFolderToolTip.SetToolTip(this.sideloadFolderButton, "Sideloads every apk from a folder");
|
||||
ToolTip uninstallAppToolTip = new ToolTip();
|
||||
uninstallAppToolTip.SetToolTip(this.uninstallAppButton, "Uninstalls selected app");
|
||||
ToolTip userjsonToolTip = new ToolTip();
|
||||
userjsonToolTip.SetToolTip(this.userjsonButton, "After you enter your username it will create an user.json file needed for some games");
|
||||
|
||||
}
|
||||
void checkForUpdate()
|
||||
{
|
||||
string localVersion = "0.9";
|
||||
string localVersion = "0.12";
|
||||
HttpClient client = new HttpClient();
|
||||
string currentVersion = client.GetStringAsync("https://raw.githubusercontent.com/nerdunit/androidsideloader/master/version").Result;
|
||||
currentVersion = currentVersion.Remove(currentVersion.Length - 1);
|
||||
|
||||
if (localVersion != currentVersion)
|
||||
{
|
||||
DialogResult dialogResult = MessageBox.Show("There is a new update, do you want to update?", "New version " + currentVersion + " available", MessageBoxButtons.YesNo);
|
||||
string changelog = client.GetStringAsync("https://raw.githubusercontent.com/nerdunit/androidsideloader/master/changelog.txt").Result;
|
||||
DialogResult dialogResult = FlexibleMessageBox.Show("There is a new update you have version " + localVersion + ", do you want to update?\nCHANGELOG\n" + changelog, "New version " + currentVersion + " available", MessageBoxButtons.YesNo);
|
||||
if (dialogResult != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
//download updated version
|
||||
using (var fileClient = new WebClient())
|
||||
{
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
fileClient.DownloadFile("https://github.com/nerdunit/androidsideloader/releases/download/v" + currentVersion + "/AndroidSideloader.exe", "Android Sideloader v" + currentVersion + ".exe");
|
||||
fileClient.DownloadFile("https://github.com/nerdunit/androidsideloader/releases/download/v" + currentVersion + "/AndroidSideloader.exe", "AndroidSideloader v" + currentVersion + ".exe");
|
||||
}
|
||||
|
||||
//melt
|
||||
Process.Start(new ProcessStartInfo()
|
||||
{
|
||||
Arguments = "/C choice /C Y /N /D Y /T 5 & Del \"" + Application.ExecutablePath + "\"",
|
||||
@@ -320,10 +317,9 @@ namespace AndroidSideloader
|
||||
FileName = "cmd.exe"
|
||||
});
|
||||
|
||||
Process.Start(Environment.CurrentDirectory + "\\Android Sideloader v" + currentVersion + ".exe");
|
||||
Process.Start(Environment.CurrentDirectory + "\\AndroidSideloader v" + currentVersion + ".exe");
|
||||
|
||||
Environment.Exit(0);
|
||||
//MessageBox.Show("Your version is outdated, the latest version is " + currentVersion + " you can download it from https://github.com/nerdunit/", "OUTDATED");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,8 +428,6 @@ namespace AndroidSideloader
|
||||
m_combo.Items.Add(obj.Remove(0, 8));
|
||||
}
|
||||
m_combo.MatchingMethod = StringMatchingMethod.NoWildcards;
|
||||
//if (allText.Length > 0)
|
||||
// MessageBox.Show("Fetched apks with success");
|
||||
}
|
||||
|
||||
private void getapk(string package)
|
||||
@@ -468,7 +462,9 @@ namespace AndroidSideloader
|
||||
|
||||
string package = m_combo.SelectedItem.ToString().Remove(m_combo.SelectedItem.ToString().Length - 1);
|
||||
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
await Task.Run(() => getapk(package));
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
|
||||
allText = allText.Remove(allText.Length - 1);
|
||||
//MessageBox.Show(allText);
|
||||
@@ -540,7 +536,7 @@ namespace AndroidSideloader
|
||||
chk.Width = 420;
|
||||
chk.Height = 17;
|
||||
chk.Text = line[i];
|
||||
chk.CheckedChanged += new EventHandler(CheckBox_Checked);
|
||||
//chk.CheckedChanged += new EventHandler(CheckBox_Checked);
|
||||
Controls.Add(chk);
|
||||
pos2 += 20;
|
||||
}
|
||||
@@ -548,11 +544,6 @@ namespace AndroidSideloader
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void changePermsBtn_Click(object sender, EventArgs e)
|
||||
@@ -570,6 +561,7 @@ namespace AndroidSideloader
|
||||
if ((c is CheckBox))
|
||||
{
|
||||
exit = false;
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
if (((CheckBox)c).Checked==true)
|
||||
{
|
||||
await Task.Run(() => changePerms(c, package, "grant"));
|
||||
@@ -578,6 +570,7 @@ namespace AndroidSideloader
|
||||
{
|
||||
await Task.Run(() => changePerms(c, package, "revoke"));
|
||||
}
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -610,11 +603,6 @@ namespace AndroidSideloader
|
||||
|
||||
}
|
||||
|
||||
private bool checkForDevice()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private async void uninstallAppButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_combo.Items.Count == 0)
|
||||
@@ -630,7 +618,9 @@ namespace AndroidSideloader
|
||||
if (dialogResult != DialogResult.Yes)
|
||||
return;
|
||||
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
await Task.Run(() => uninstallPackage(package));
|
||||
progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
|
||||
notify(allText);
|
||||
}
|
||||
@@ -652,7 +642,7 @@ namespace AndroidSideloader
|
||||
m_combo.MatchingMethod = mi.Value;
|
||||
}
|
||||
|
||||
private async void sideloadFolderButton_Click(object sender, EventArgs e)
|
||||
private void sideloadFolderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var dialog = new FolderSelectDialog
|
||||
{
|
||||
@@ -660,15 +650,29 @@ namespace AndroidSideloader
|
||||
};
|
||||
if (dialog.Show(Handle))
|
||||
{
|
||||
string[] files = Directory.GetFiles(dialog.FileName);
|
||||
foreach (string file in files)
|
||||
{
|
||||
await Task.Run(() => sideload(file));
|
||||
}
|
||||
recursiveSideload(dialog.FileName);
|
||||
}
|
||||
else return;
|
||||
|
||||
notify("Done Mass Sideloading");
|
||||
notify("Done bulk sideloading");
|
||||
}
|
||||
|
||||
private async void recursiveSideload(string location)
|
||||
{
|
||||
string[] files = Directory.GetFiles(location);
|
||||
string[] childDirectories = Directory.GetDirectories(location);
|
||||
for (int i = 0; i < files.Length; i++)
|
||||
{
|
||||
string extension = Path.GetExtension(files[i]);
|
||||
if (extension == ".apk")
|
||||
{
|
||||
await Task.Run(() => sideload(files[i]));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < childDirectories.Length; i++)
|
||||
{
|
||||
recursiveSideload(childDirectories[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void aboutBtn_Click(object sender, EventArgs e)
|
||||
@@ -676,8 +680,9 @@ namespace AndroidSideloader
|
||||
string about = @" - The icon of the app contains an icon made by icon8.com
|
||||
- Software orignally coded by rookie.lol#7897
|
||||
- Thanks to https://stackoverflow.com/users/57611/erike for the folder browser dialog code
|
||||
- Thanks to Serge Weinstock for developing SergeUtils, it is used to search the combo box";
|
||||
MessageBox.Show(about);
|
||||
- Thanks to Serge Weinstock for developing SergeUtils, which is used to search the combo box
|
||||
- Thanks to Mike Gold https://www.c-sharpcorner.com/members/mike-gold2 for the scrollable message box";
|
||||
FlexibleMessageBox.Show(about);
|
||||
}
|
||||
|
||||
|
||||
@@ -687,26 +692,9 @@ namespace AndroidSideloader
|
||||
|
||||
DispatcherTimer Timer99 = new DispatcherTimer();
|
||||
|
||||
public PerformanceCounter myCounter =
|
||||
new PerformanceCounter("PhysicalDisk", "Disk Read Bytes/sec", "_Total");
|
||||
public PerformanceCounter myCounter2 =
|
||||
new PerformanceCounter("PhysicalDisk", "Disk Write Bytes/sec", "_Total");
|
||||
|
||||
public Int32 j = 0;
|
||||
public Int32 k = 0;
|
||||
public void Timer99_Tick(System.Object sender, System.EventArgs e)
|
||||
|
||||
{
|
||||
//Console.Clear();
|
||||
j = Convert.ToInt32(myCounter.NextValue());
|
||||
j = j / 1024;
|
||||
k = Convert.ToInt32(myCounter2.NextValue());
|
||||
k = k / 1024;
|
||||
|
||||
try { progressBar.Value += k*10; } catch { progressBar.Maximum = 100; progressBar.Value = 90; Timer99.Stop(); } //fake progress bar, for some reason performance counters are retarded or i am
|
||||
//Console.WriteLine(j);
|
||||
label.Text = "Read " + j.ToString();
|
||||
label1.Text = "Write " + k.ToString();
|
||||
|
||||
}
|
||||
|
||||
@@ -715,6 +703,12 @@ namespace AndroidSideloader
|
||||
usernameForm usernameForm1 = new usernameForm();
|
||||
usernameForm1.Show();
|
||||
}
|
||||
|
||||
private void settingsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SettingsForm settingsForm = new SettingsForm();
|
||||
settingsForm.Show();
|
||||
}
|
||||
}
|
||||
|
||||
public class MethodItem
|
||||
|
||||
57
README.md
57
README.md
@@ -1,55 +1,8 @@
|
||||
# androidsideloader
|
||||
|
||||
Changelog
|
||||
The icon of the app contains an icon made by icon8.com
|
||||
|
||||
0.8.5
|
||||
- Added auto update download
|
||||
- Fixed a bug where if you didn't have the adb folder it would crash
|
||||
|
||||
0.8
|
||||
- Every command now shows progress on title bar
|
||||
- Automatically run Adb Devices and List Apps on form startup
|
||||
- You can now search the App List Combo Box
|
||||
- Cleaned some code
|
||||
|
||||
0.7
|
||||
- Fixed UI Freezes
|
||||
- Added Uninstall APK Button
|
||||
- Added Launch package Button
|
||||
- Removed loading bar
|
||||
|
||||
0.6
|
||||
- Added List Apk Perms button
|
||||
- Added Change Permissions button
|
||||
- Added dinamically added checkbox for permisssions
|
||||
- The software now downloads adb from master instead of v0.3 release
|
||||
|
||||
0.5
|
||||
- Removed Flash Firmware
|
||||
- Redesigned UI
|
||||
- Reworked RunAdbCommand function (now it will be possible to do stuff I wasnt able to do before)
|
||||
- Replaced Ui Buttons, still needs work
|
||||
- Added List apk button
|
||||
- Added List apk combo box
|
||||
- Added get apk function
|
||||
- Cleaned a bit of code
|
||||
|
||||
0.4
|
||||
- Added auto download of adb archive
|
||||
- Added auto extraction of adb archive
|
||||
|
||||
0.3
|
||||
- Added new form, you can run custom adb commands now
|
||||
- Added recover and backup app data
|
||||
- Removed Select APK and Select OBB Buttons
|
||||
- Removed tooltips from removed buttons
|
||||
- Sideload APK and Copy Obb buttons now also make you select the file/folder
|
||||
- Improved firmware button
|
||||
|
||||
0.2
|
||||
- Added Flash Firmware button
|
||||
- Added few tooltips
|
||||
- Renamed buttons
|
||||
|
||||
0.1
|
||||
- Initial Release
|
||||
Special thanks to
|
||||
- https://stackoverflow.com/users/57611/erike for the folder browser dialog code
|
||||
- Serge Weinstock for developing SergeUtils, which is used to search the combo box
|
||||
- Mike Gold https://www.c-sharpcorner.com/members/mike-gold2 for the scrollable message box
|
||||
|
||||
118
SettingsForm.Designer.cs
generated
Normal file
118
SettingsForm.Designer.cs
generated
Normal file
@@ -0,0 +1,118 @@
|
||||
namespace AndroidSideloader
|
||||
{
|
||||
partial class SettingsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.checkForUpdatesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.applyButton = new System.Windows.Forms.Button();
|
||||
this.enableMessageBoxesCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.copyMessageToClipboardCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.resetSettingsButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// checkForUpdatesCheckBox
|
||||
//
|
||||
this.checkForUpdatesCheckBox.AutoSize = true;
|
||||
this.checkForUpdatesCheckBox.Location = new System.Drawing.Point(13, 13);
|
||||
this.checkForUpdatesCheckBox.Name = "checkForUpdatesCheckBox";
|
||||
this.checkForUpdatesCheckBox.Size = new System.Drawing.Size(113, 17);
|
||||
this.checkForUpdatesCheckBox.TabIndex = 0;
|
||||
this.checkForUpdatesCheckBox.Text = "Check for updates";
|
||||
this.checkForUpdatesCheckBox.UseVisualStyleBackColor = true;
|
||||
this.checkForUpdatesCheckBox.CheckedChanged += new System.EventHandler(this.checkForUpdatesCheckBox_CheckedChanged);
|
||||
//
|
||||
// applyButton
|
||||
//
|
||||
this.applyButton.Location = new System.Drawing.Point(357, 183);
|
||||
this.applyButton.Name = "applyButton";
|
||||
this.applyButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.applyButton.TabIndex = 1;
|
||||
this.applyButton.Text = "Apply";
|
||||
this.applyButton.UseVisualStyleBackColor = true;
|
||||
this.applyButton.Click += new System.EventHandler(this.applyButton_Click);
|
||||
//
|
||||
// enableMessageBoxesCheckBox
|
||||
//
|
||||
this.enableMessageBoxesCheckBox.AutoSize = true;
|
||||
this.enableMessageBoxesCheckBox.Location = new System.Drawing.Point(13, 36);
|
||||
this.enableMessageBoxesCheckBox.Name = "enableMessageBoxesCheckBox";
|
||||
this.enableMessageBoxesCheckBox.Size = new System.Drawing.Size(227, 17);
|
||||
this.enableMessageBoxesCheckBox.TabIndex = 2;
|
||||
this.enableMessageBoxesCheckBox.Text = "Enable Message Boxes on task completed";
|
||||
this.enableMessageBoxesCheckBox.UseVisualStyleBackColor = true;
|
||||
this.enableMessageBoxesCheckBox.CheckedChanged += new System.EventHandler(this.enableMessageBoxesCheckBox_CheckedChanged);
|
||||
//
|
||||
// copyMessageToClipboardCheckBox
|
||||
//
|
||||
this.copyMessageToClipboardCheckBox.AutoSize = true;
|
||||
this.copyMessageToClipboardCheckBox.Location = new System.Drawing.Point(13, 59);
|
||||
this.copyMessageToClipboardCheckBox.Name = "copyMessageToClipboardCheckBox";
|
||||
this.copyMessageToClipboardCheckBox.Size = new System.Drawing.Size(153, 17);
|
||||
this.copyMessageToClipboardCheckBox.TabIndex = 3;
|
||||
this.copyMessageToClipboardCheckBox.Text = "Copy message to clipboard";
|
||||
this.copyMessageToClipboardCheckBox.UseVisualStyleBackColor = true;
|
||||
this.copyMessageToClipboardCheckBox.CheckedChanged += new System.EventHandler(this.copyMessageToClipboardCheckBox_CheckedChanged);
|
||||
//
|
||||
// resetSettingsButton
|
||||
//
|
||||
this.resetSettingsButton.Location = new System.Drawing.Point(256, 183);
|
||||
this.resetSettingsButton.Name = "resetSettingsButton";
|
||||
this.resetSettingsButton.Size = new System.Drawing.Size(95, 23);
|
||||
this.resetSettingsButton.TabIndex = 4;
|
||||
this.resetSettingsButton.Text = "Reset Settings";
|
||||
this.resetSettingsButton.UseVisualStyleBackColor = true;
|
||||
this.resetSettingsButton.Click += new System.EventHandler(this.resetSettingsButton_Click);
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(444, 218);
|
||||
this.Controls.Add(this.resetSettingsButton);
|
||||
this.Controls.Add(this.copyMessageToClipboardCheckBox);
|
||||
this.Controls.Add(this.enableMessageBoxesCheckBox);
|
||||
this.Controls.Add(this.applyButton);
|
||||
this.Controls.Add(this.checkForUpdatesCheckBox);
|
||||
this.Name = "SettingsForm";
|
||||
this.Text = "SettingsForm";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SettingsForm_FormClosing);
|
||||
this.Load += new System.EventHandler(this.SettingsForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.CheckBox checkForUpdatesCheckBox;
|
||||
private System.Windows.Forms.Button applyButton;
|
||||
private System.Windows.Forms.CheckBox enableMessageBoxesCheckBox;
|
||||
private System.Windows.Forms.CheckBox copyMessageToClipboardCheckBox;
|
||||
private System.Windows.Forms.Button resetSettingsButton;
|
||||
}
|
||||
}
|
||||
77
SettingsForm.cs
Normal file
77
SettingsForm.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AndroidSideloader
|
||||
{
|
||||
public partial class SettingsForm : Form
|
||||
{
|
||||
public SettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.CenterToParent();
|
||||
|
||||
intSettings();
|
||||
|
||||
intToolTips();
|
||||
}
|
||||
|
||||
private void intSettings()
|
||||
{
|
||||
checkForUpdatesCheckBox.Checked = Properties.Settings.Default.checkForUpdates;
|
||||
enableMessageBoxesCheckBox.Checked = Properties.Settings.Default.enableMessageBoxes;
|
||||
copyMessageToClipboardCheckBox.Checked = Properties.Settings.Default.copyMessageToClipboard;
|
||||
}
|
||||
|
||||
void intToolTips()
|
||||
{
|
||||
ToolTip checkForUpdatesToolTip = new ToolTip();
|
||||
checkForUpdatesToolTip.SetToolTip(this.checkForUpdatesCheckBox, "If this is checked, the software will check for available updates");
|
||||
ToolTip enableMessageBoxesToolTip = new ToolTip();
|
||||
enableMessageBoxesToolTip.SetToolTip(this.enableMessageBoxesCheckBox, "If this is checked, the software will display message boxes after every completed task");
|
||||
ToolTip copyMessageToClipboardToolTip = new ToolTip();
|
||||
copyMessageToClipboardToolTip.SetToolTip(this.copyMessageToClipboardCheckBox, "If this is checked, after each task the software will set the result message to your clipboard");
|
||||
}
|
||||
|
||||
private void applyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void checkForUpdatesCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.checkForUpdates = checkForUpdatesCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void enableMessageBoxesCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.enableMessageBoxes = enableMessageBoxesCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void copyMessageToClipboardCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.copyMessageToClipboard = copyMessageToClipboardCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void resetSettingsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.Reset();
|
||||
intSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
SettingsForm.resx
Normal file
120
SettingsForm.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
79
changelog.txt
Normal file
79
changelog.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
0.12
|
||||
+ Added settings form
|
||||
+ Added progress bar (again)
|
||||
+ Added a new user.json
|
||||
= Fixed crash on some systems (PerformanceCounter)
|
||||
= Fixed crash because of file name inconsistency
|
||||
- Removed performance counters because they made the software not work for some people
|
||||
|
||||
0.11
|
||||
+ Changed normal message boxes to flexible ones
|
||||
+ Added changelog to update message
|
||||
= Improved update message
|
||||
- Removed progressbar
|
||||
|
||||
0.10
|
||||
+ Added few tooltips
|
||||
+ Sideload folder now works for all apks (recursive search)
|
||||
= Obb copy and Sideload progress bar problems should be fixed
|
||||
= Fixed user.json not working if the any of folder had spaces
|
||||
= Switched back to Message Boxes
|
||||
|
||||
0.9
|
||||
+ Added the buggy progress bar back, uses different "logic"
|
||||
+ Added an icon (Increased the exe size by like 300% just with that)
|
||||
+ Added sideload folder button
|
||||
+ Added Creat user.json button and form
|
||||
+ Changed Message Boxes to notifications
|
||||
|
||||
0.8.5
|
||||
+ Added auto update download
|
||||
= Fixed a bug where if you didn't have the adb folder it would crash
|
||||
|
||||
0.8
|
||||
+ Every command now shows progress on title bar
|
||||
+ Automatically run Adb Devices and List Apps on form startup
|
||||
+ You can now search the App List Combo Box
|
||||
= Cleaned some code
|
||||
|
||||
0.7
|
||||
= Fixed UI Freezes
|
||||
+ Added Uninstall APK Button
|
||||
+ Added Launch package Button
|
||||
- Removed loading bar
|
||||
|
||||
0.6
|
||||
+ Added List Apk Perms button
|
||||
+ Added Change Permissions button
|
||||
+ Added dinamically added checkbox for permisssions
|
||||
= The software now downloads adb from master instead of v0.3 release
|
||||
|
||||
0.5
|
||||
- Removed Flash Firmware
|
||||
= Redesigned UI
|
||||
= Reworked RunAdbCommand function (now it will be possible to do stuff I wasnt able to do before)
|
||||
= Replaced Ui Buttons, still needs work
|
||||
+ Added List apk button
|
||||
+ Added List apk combo box
|
||||
+ Added get apk function
|
||||
= Cleaned a bit of code
|
||||
|
||||
0.4
|
||||
+ Added auto download of adb archive
|
||||
+ Added auto extraction of adb archive
|
||||
|
||||
0.3
|
||||
+ Added new form, you can run custom adb commands now
|
||||
+ Added recover and backup app data
|
||||
- Removed Select APK and Select OBB Buttons
|
||||
- Removed tooltips from removed buttons
|
||||
+ Sideload APK and Copy Obb buttons now also make you select the file/folder
|
||||
+ Improved firmware button
|
||||
|
||||
0.2
|
||||
+ Added Flash Firmware button
|
||||
+ Added few tooltips
|
||||
+ Renamed buttons
|
||||
|
||||
0.1
|
||||
+ Initial Release
|
||||
@@ -30,7 +30,7 @@ namespace AndroidSideloader
|
||||
|
||||
File.WriteAllText("user.json", "{\"username\":\"" + textBox1.Text + "\"}");
|
||||
|
||||
string command = "push " + Environment.CurrentDirectory + "\\user.json " + " /sdcard/";
|
||||
string command = "push \"" + Environment.CurrentDirectory + "\\user.json\" " + " /sdcard/";
|
||||
|
||||
|
||||
Process cmd = new Process();
|
||||
|
||||
Reference in New Issue
Block a user