forked from nerdunit/androidsideloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpoofForm.cs
More file actions
74 lines (61 loc) · 2.31 KB
/
SpoofForm.cs
File metadata and controls
74 lines (61 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using JR.Utils.GUI.Forms;
using System;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
using Spoofer;
namespace AndroidSideloader
{
public partial class SpoofForm : Form
{
public SpoofForm()
{
InitializeComponent();
}
private async void SpoofButton_Click(object sender, EventArgs e)
{
if (!spoofer.HasDependencies())
{
MessageBox.Show("You are missing the dependencies... Cannot spoof games");
return;
}
string NewPackageName = PackageNameTextBox.Text;
string path;
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "Android apps (*.apk)|*.apk";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
path = openFileDialog.FileName;
else
return;
}
progressBar1.Style = ProgressBarStyle.Marquee;
string output = "";
//Spawn spoofer in a new thread so the ui isn't blocked
Thread t1 = new Thread(() =>
{
spoofer.Init();
output += spoofer.SpoofApk(path, NewPackageName);
});
t1.IsBackground = true;
t1.Start();
while (t1.IsAlive)
await Task.Delay(100);
progressBar1.Style = ProgressBarStyle.Continuous;
if (output.Contains("is not recognized as an internal or external command"))
FlexibleMessageBox.Show(Sideloader.SpooferWarning);
else
FlexibleMessageBox.Show($"App spoofed from {spoofer.originalPackageName} to {NewPackageName}");
}
private void SpoofForm_Load(object sender, EventArgs e)
{
PackageNameTextBox.Text = Utilities.GeneralUtilities.RandomPackageName();
}
private void RandomizeButton_Click(object sender, EventArgs e)
{
PackageNameTextBox.Text = Utilities.GeneralUtilities.RandomPackageName();
}
}
}