diff --git a/.DS_Store b/.DS_Store
index ff5d7ee..6356470 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/.idea/.idea.AndroidDebloater/.idea/avalonia.xml b/.idea/.idea.AndroidDebloater/.idea/avalonia.xml
index 54cff0e..62e13f3 100644
--- a/.idea/.idea.AndroidDebloater/.idea/avalonia.xml
+++ b/.idea/.idea.AndroidDebloater/.idea/avalonia.xml
@@ -5,6 +5,7 @@
diff --git a/.idea/.idea.AndroidDebloater/.idea/workspace.xml b/.idea/.idea.AndroidDebloater/.idea/workspace.xml
index 060abe9..2b17e37 100644
--- a/.idea/.idea.AndroidDebloater/.idea/workspace.xml
+++ b/.idea/.idea.AndroidDebloater/.idea/workspace.xml
@@ -7,12 +7,7 @@
-
-
-
-
-
-
+
@@ -49,7 +44,7 @@
".NET Project.AndroidDebloater.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
- "git-widget-placeholder": "manufacturer-specific-debloats",
+ "git-widget-placeholder": "package-selection",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@@ -101,23 +96,4 @@
-
-
-
-
- file://$PROJECT_DIR$/MainWindow.axaml.cs
- 46
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Components/.DS_Store b/Components/.DS_Store
index 18adf90..102859f 100644
Binary files a/Components/.DS_Store and b/Components/.DS_Store differ
diff --git a/Components/AndroidPackage.cs b/Components/AndroidPackage.cs
new file mode 100644
index 0000000..0c37843
--- /dev/null
+++ b/Components/AndroidPackage.cs
@@ -0,0 +1,31 @@
+using System.ComponentModel;
+
+namespace AndroidDebloater.Components;
+
+public class AndroidPackage : INotifyPropertyChanged
+{
+ private string _text;
+ private bool _isChecked;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public string Text
+ {
+ get => _text;
+ set
+ {
+ _text = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Text)));
+ }
+ }
+
+ public bool IsChecked
+ {
+ get => _isChecked;
+ set
+ {
+ _isChecked = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsChecked)));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Components/ShellExecutor.cs b/Components/ShellExecutor.cs
index b5fb4b6..a85a4d5 100644
--- a/Components/ShellExecutor.cs
+++ b/Components/ShellExecutor.cs
@@ -14,6 +14,16 @@ public static string ListADB()
return AdbHelper.ExecuteAdbCommand("devices"); //Execute(command);
}
+ public static string GetPackages()
+ {
+ return AdbHelper.ExecuteAdbCommand("shell cmd package list packages");
+ }
+
+ public static string RemovePackage(string packageName)
+ {
+ return AdbHelper.ExecuteAdbCommand("shell pm uninstall --user 0 " + packageName);
+ }
+
public static string StartDebloat(int package)
{
switch (package)
diff --git a/MainWindow.axaml b/MainWindow.axaml
index c826e80..402ba00 100644
--- a/MainWindow.axaml
+++ b/MainWindow.axaml
@@ -4,10 +4,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AndroidDebloater.MainWindow"
+ xmlns:components="clr-namespace:AndroidDebloater.Components"
Title="AndroidDebloater"
Width="800" Height="450">
+
@@ -16,11 +18,27 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,18 +49,15 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
@@ -53,23 +68,56 @@
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs
index d9006d0..7afe0b3 100644
--- a/MainWindow.axaml.cs
+++ b/MainWindow.axaml.cs
@@ -1,25 +1,42 @@
using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Reflection;
using System.Text.RegularExpressions;
+using System.Threading.Tasks;
using AndroidDebloater.Components;
using Avalonia.Controls;
using Avalonia.Interactivity;
+using Avalonia.Media.TextFormatting.Unicode;
using MsBox.Avalonia;
namespace AndroidDebloater
{
public partial class MainWindow : Window
{
+ private ObservableCollection _items;
+
public MainWindow()
{
InitializeComponent();
DebloatBtn.IsEnabled = false;
+ CDebloatBtn.IsEnabled = false;
mSelector.IsEnabled = false;
+ sSelector.IsEnabled = false;
+ ScriptPanel.IsVisible = false;
+ CustomPanel.IsVisible = false;
+ cSelector.IsEnabled = false;
+ clOutput.Text = BuildHelp();
}
public void ShowHelp(object sender, RoutedEventArgs args)
{
- var helpBox = MessageBoxManager.GetMessageBoxStandard("Help", "Please Enable Developer-Mode on your Android Device by clicking the Build-Number 7 Times, then in Developer-Options enable USB Debugging.\nWhen plugging your device into your PC it should show a message about trusting the PC. Click allow.", MsBox.Avalonia.Enums.ButtonEnum.Ok);
+ var helpBox = MessageBoxManager.GetMessageBoxStandard("Help", "Welcome to AndroidDebloater!\n\n"
+ + "To get started, please enable USB-Debugging on your Phone.\n"
+ + "To do this, go to the about page in your settings and click the 'Build number' 7 times.\n"
+ + "Next, go to Developer Settings and Enable USB-Debugging.\n\n"
+ + "Now connect your phone, allow Debugging for your PC on your Phone and Click the 'List ADB Devices' button.\n\n"
+ + "If there are any problems when using this App, feel free to open an Issue on GitHub.", MsBox.Avalonia.Enums.ButtonEnum.Ok);
var result = helpBox.ShowAsPopupAsync(this);
}
@@ -36,13 +53,16 @@ public void ListDevices(object sender, RoutedEventArgs args)
{
Console.WriteLine($"Matched: {line.Trim()}");
DebloatBtn.IsEnabled = true;
+ CDebloatBtn.IsEnabled = true;
+ cSelector.IsEnabled = true;
+ sSelector.IsEnabled = true;
+ ScriptPanel.IsVisible = true;
}
}
}
public void StartDebloater(object sender, RoutedEventArgs args)
{
- int packageValue;
if ((bool)gDebloat.IsChecked)
{
@@ -106,5 +126,70 @@ public void DisableSelector(object sender, RoutedEventArgs args)
{
mSelector.IsEnabled = false;
}
+
+ public void ShowScripts(object sender, RoutedEventArgs args)
+ {
+ ScriptPanel.IsVisible = true;
+ CustomPanel.IsVisible = false;
+ }
+
+ public void ShowCustomSelector(object sender, RoutedEventArgs args)
+ {
+ CustomPanel.IsVisible = true;
+ ScriptPanel.IsVisible = false;
+
+ _items = new ObservableCollection(CreateObservableCollection(ShellExecutor.GetPackages()));
+
+ // Get the ItemsControl by name and set its ItemsSource
+ var packageControl = this.FindControl("PackageList");
+ packageControl.ItemsSource = _items;
+ }
+
+ private void RemoveSelected(object sender, RoutedEventArgs e)
+ {
+ var selectedItems = new List();
+ foreach (var item in _items)
+ {
+ if (item.IsChecked)
+ {
+ selectedItems.Add(item.Text);
+ }
+ }
+
+ clOutput.Text = "Uninstalling " + selectedItems.Count + " packages... \n";
+
+ foreach (var item in selectedItems)
+ {
+ clOutput.Text += item + ": " +ShellExecutor.RemovePackage(item);
+ }
+ }
+
+ public ObservableCollection CreateObservableCollection(string input)
+ {
+ var collection = new ObservableCollection();
+
+ // Split the input into lines
+ var lines = input.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
+
+ foreach (var line in lines)
+ {
+ // Remove the "package:" prefix and add to the collection
+ var cleanedLine = line.Replace("package:", "").Trim();
+ collection.Add(new AndroidPackage { Text = cleanedLine, IsChecked = false });
+ }
+
+ return collection;
+ }
+
+ public string BuildHelp()
+ {
+ string help = "Welcome to AndroidDebloater!\n\n"
+ + "To get started, please enable USB-Debugging on your Phone.\n"
+ + "To do this, go to the about page in your settings and click the 'Build number' 7 times.\n"
+ + "Next, go to Developer Settings and Enable USB-Debugging.\n\n"
+ + "Now connect your phone, allow Debugging for your PC on your Phone and Click the 'List ADB Devices' button.\n\n"
+ + "If there are any problems when using this App, feel free to open an Issue on GitHub.";
+ return help;
+ }
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 4d1ec19..8d9313a 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,8 @@



+
+
@@ -47,9 +49,9 @@ If sucessful, you can choose your Package and click "Start Debloat"
## 🚧 AndroidDebloater 2.0 Roadmap
-- [ ] Individual Package Selection
-- [ ] More detailed help section
-- [ ] Rework UI (adjust for new Feature-Set)
+- [x] Individual Package Selection
+- [x] More detailed help section
+- [x] Rework UI (adjust for new Feature-Set)
Check out the [open issues](https://github.com/massimo-rnd/AndroidDebloater/issues) for more.