-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e0ca7ab
Showing
17 changed files
with
2,668 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31129.286 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneKeyBreventCaller", "OneKeyBreventCaller\OneKeyBreventCaller.csproj", "{91930454-244A-4A8E-84DA-26DD572160F2}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{91930454-244A-4A8E-84DA-26DD572160F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{91930454-244A-4A8E-84DA-26DD572160F2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{91930454-244A-4A8E-84DA-26DD572160F2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{91930454-244A-4A8E-84DA-26DD572160F2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {93FD10AD-A553-47C4-BC83-A7BF3AF72E1E} | ||
EndGlobalSection | ||
EndGlobal |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Windows.Forms; | ||
|
||
namespace OneKeyBreventCaller | ||
{ | ||
public partial class BreventCallerMain : Form | ||
{ | ||
private int count; | ||
private Process p = new Process(); | ||
|
||
private void ProcessInit() | ||
{ | ||
p.StartInfo.FileName = "./ADB_Bin/adb.exe";//设定程序名 | ||
p.StartInfo.UseShellExecute = false; //关闭shell的使用 | ||
p.StartInfo.RedirectStandardInput = true; //重定向标准输入 | ||
p.StartInfo.RedirectStandardOutput = true; //重定向标准输出 | ||
p.StartInfo.RedirectStandardError = true; //重定向错误输出 | ||
p.StartInfo.CreateNoWindow = true;//设置不显示窗口 | ||
} | ||
|
||
private void DeviceScanner() | ||
{ | ||
ProcessInit(); | ||
p.StartInfo.Arguments = " kill-server"; | ||
p.Start(); | ||
p.Close(); | ||
p.StartInfo.Arguments = " shell getprop ro.product.model"; | ||
p.Start(); | ||
DeviceInfoStr.Text = p.StandardOutput.ReadToEnd(); | ||
p.Close(); | ||
if (DeviceInfoStr.Text == "") | ||
{ | ||
if (count <= 5) | ||
{ | ||
DialogResult result = MessageBox.Show(@"请确保手机已连接并开启USB调试!", @"提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); | ||
if (result == DialogResult.OK) | ||
{ | ||
DeviceScanner(); | ||
} | ||
else if (result == DialogResult.Cancel) | ||
{ | ||
DeviceInfoStr.Text = @"(暂无)"; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public BreventCallerMain() | ||
{ | ||
InitializeComponent(); | ||
} | ||
private void BreventCallerMain_Load(object sender, EventArgs e) | ||
{ | ||
DeviceScanner(); | ||
} | ||
private void Refreshbutton_Click(object sender, EventArgs e) | ||
{ | ||
DeviceScanner(); | ||
} | ||
|
||
private void Run_Click(object sender, EventArgs e) | ||
{ | ||
ProcessInit(); | ||
p.StartInfo.Arguments = " -d shell sh /data/data/me.piebridge.brevent/brevent.sh"; | ||
p.Start(); | ||
string msg = p.StandardOutput.ReadToEnd(); | ||
p.Close(); | ||
if(msg != "") | ||
{ | ||
DialogResult res = MessageBox.Show("黑阈启动成功!\n"+msg, @"恭喜", MessageBoxButtons.OK, MessageBoxIcon.Information); | ||
if (res == DialogResult.OK) | ||
{ | ||
Close(); | ||
} | ||
} | ||
else | ||
{ | ||
MessageBox.Show(@"黑阈启动失败,请确保手机已连接并开启USB调试!", @"提示", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.