Skip to content

Commit

Permalink
fix device data extraction and task manager app filter
Browse files Browse the repository at this point in the history
  • Loading branch information
msartore committed May 22, 2024
1 parent e479148 commit 147a9c8
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 113 deletions.
6 changes: 3 additions & 3 deletions ATA-GUI/ATA-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<Copyright>© 2021-2024 Massimiliano Sartore</Copyright>

<!-- Versioning -->
<Version>3.7.4.0</Version>
<AssemblyVersion>3.7.4.0</AssemblyVersion>
<FileVersion>3.7.4.0</FileVersion>
<Version>3.7.5.0</Version>
<AssemblyVersion>3.7.5.0</AssemblyVersion>
<FileVersion>3.7.5.0</FileVersion>

<!-- Publish settings -->
<PublishUrl>publish\</PublishUrl>
Expand Down
6 changes: 3 additions & 3 deletions ATA-GUI/Classes/ATA.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Net.Http;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;

namespace ATA_GUI.Classes
{
internal class ATA
{
public static readonly string CURRENTVERSION = "v3.7.4";
public static readonly string CURRENTVERSION = "v3.7.5";
public static readonly string IPFileName = "IPList.txt";

public HashSet<string> IPList { get; } = new HashSet<string>();
Expand Down
6 changes: 3 additions & 3 deletions ATA-GUI/Forms/AboutForm.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
using ATA_GUI.Classes;
using ATA_GUI.Classes;
using ATA_GUI.Utils;
using System;
using System.Windows.Forms;

namespace ATA_GUI
{
Expand Down
6 changes: 3 additions & 3 deletions ATA-GUI/Forms/BloatwareRemoverForm.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using ATA_GUI.Classes;
using ATA_GUI.Utils;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using ATA_GUI.Classes;
using ATA_GUI.Utils;

namespace ATA_GUI
{
Expand Down
4 changes: 2 additions & 2 deletions ATA-GUI/Forms/BootloaderMenuForm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using ATA_GUI.Utils;
using System;
using System.Windows.Forms;
using ATA_GUI.Utils;

namespace ATA_GUI
{
Expand Down
6 changes: 3 additions & 3 deletions ATA-GUI/Forms/DefaultAppForm.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
using ATA_GUI.Classes;
using ATA_GUI.Classes;
using ATA_GUI.Utils;
using System;
using System.Windows.Forms;

namespace ATA_GUI
{
Expand Down
6 changes: 3 additions & 3 deletions ATA-GUI/Forms/DeviceLogsForm.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using ATA_GUI.Classes;
using ATA_GUI.Utils;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using ATA_GUI.Classes;
using ATA_GUI.Utils;

namespace ATA_GUI
{
Expand Down
4 changes: 2 additions & 2 deletions ATA-GUI/Forms/FeedbackForm.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using ATA_GUI.Utils;
using System;
using System.IO;
using System.Windows.Forms;
using System.Xml;
using ATA_GUI.Utils;

namespace ATA_GUI
{
Expand Down
14 changes: 7 additions & 7 deletions ATA-GUI/Forms/LoadingForm.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using ATA_GUI.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using ATA_GUI.Utils;

namespace ATA_GUI
{
Expand Down Expand Up @@ -90,7 +90,7 @@ private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
labelFileName.Text = x;
Refresh();
string result = ConsoleProcess.adbFastbootCommandR(command + x, 0).ToLowerInvariant();
string result = ConsoleProcess.adbProcess(command + x).ToLowerInvariant();
if (result.Contains("not found") || result.Contains("fail") || result.Trim().Length == 0)
{
failedApps.Add(x);
Expand All @@ -100,15 +100,15 @@ private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)

break;
case OperationType.Transfer:
_ = ConsoleProcess.adbFastbootCommandR(new[] { "-s " + deviceSerial + " shell mkdir sdcard/ATA" }, 0);
_ = ConsoleProcess.adbProcess("-s " + deviceSerial + " shell mkdir sdcard/ATA");

array.ForEach(file =>
{
if (File.Exists(file))
{
labelFileName.Text = file[(file.LastIndexOf('\\') + 1)..];
Refresh();
if (ConsoleProcess.adbFastbootCommandR(new[] { "-s " + deviceSerial + " push " + file + " sdcard/ATA " }, 0) == null)
if (ConsoleProcess.adbProcess("-s " + deviceSerial + " push " + file + " sdcard/ATA ") == null)
{
failedApps.Add(file);
}
Expand All @@ -128,10 +128,10 @@ private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
labelFileName.Text = x;
Refresh();
string[] pathList = ConsoleProcess.adbFastbootCommandR("-s " + deviceSerial + " shell pm path " + x, 0).Split('\n').Where(it => it.Contains("package")).ToArray();
string[] pathList = ConsoleProcess.adbProcess("-s " + deviceSerial + " shell pm path " + x).Split('\n').Where(it => it.Contains("package")).ToArray();
foreach (string path in pathList)
{
string result = ConsoleProcess.adbFastbootCommandR(("-s " + deviceSerial + " pull " + path.Replace("package:", "").Trim() + " " + Application.StartupPath + "APKS\\" + x + "_" + path[(path.LastIndexOf('/') + 1)..]).Trim(), 0);
string result = ConsoleProcess.adbProcess(("-s " + deviceSerial + " pull " + path.Replace("package:", "").Trim() + " " + Application.StartupPath + "APKS\\" + x + "_" + path[(path.LastIndexOf('/') + 1)..]).Trim());
if (!result.Contains("file pulled"))
{
failedApps.Add(result);
Expand Down
94 changes: 47 additions & 47 deletions ATA-GUI/Forms/MainForm.Designer.cs

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

23 changes: 11 additions & 12 deletions ATA-GUI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
using ATA_GUI.Classes;
using ATA_GUI.Forms;
using ATA_GUI.Utils;
using Ionic.Zip;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand All @@ -13,12 +19,6 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using ATA_GUI.Classes;
using ATA_GUI.Forms;
using ATA_GUI.Utils;
using Ionic.Zip;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ATA_GUI
{
Expand Down Expand Up @@ -251,8 +251,7 @@ private void ExtractDeviceData()
string[] arrayDeviceInfoCommands = { "-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.build.version.release", "-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.build.user",
"-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.product.cpu.abilist", "-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.product.manufacturer" , "-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.product.model",
"-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.product.board", "-s "+ ATA.CurrentDeviceSelected.ID +" shell getprop ro.product.device"};
string deviceinfo = ConsoleProcess.adbFastbootCommandR(arrayDeviceInfoCommands, 0);
string[] arrayDeviceInfo = deviceinfo.Split('\n');
string[] arrayDeviceInfo = ConsoleProcess.adbFastbootCommandR(arrayDeviceInfoCommands, 0);

if (arrayDeviceInfo.Length > 6)
{
Expand Down Expand Up @@ -283,12 +282,12 @@ private void ExtractDeviceData()
}

labelAV.Text = arrayDeviceInfo[0];
labelBU.Text = arrayDeviceInfo[1];
labelCA.Text = arrayDeviceInfo[2];
labelBuildU.Text = arrayDeviceInfo[1];
labelCPUAb.Text = arrayDeviceInfo[2];
labelManu.Text = arrayDeviceInfo[3];
labelModel.Text = arrayDeviceInfo[4];
labelB.Text = arrayDeviceInfo[5];
labelD.Text = arrayDeviceInfo[6];
labelBoard.Text = arrayDeviceInfo[5];
labelDevice.Text = arrayDeviceInfo[6];

if (arrayDeviceInfo.Length > 6)
{
Expand Down
3 changes: 3 additions & 0 deletions ATA-GUI/Forms/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>853, 19</value>
</metadata>
<metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down
4 changes: 2 additions & 2 deletions ATA-GUI/Forms/ScrollableMessageBoxForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Windows.Forms;
using ATA_GUI.Utils;
using ATA_GUI.Utils;
using System.Windows.Forms;

namespace ATA_GUI
{
Expand Down
8 changes: 4 additions & 4 deletions ATA-GUI/Forms/SettingsForm.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.IO;
using System.Windows.Forms;
using ATA_GUI.Classes;
using ATA_GUI.Classes;
using ATA_GUI.Utils;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.Windows.Forms;

namespace ATA_GUI
{
Expand Down
Loading

0 comments on commit 147a9c8

Please sign in to comment.