[AT&T, Rogers HTC One X, Telstra One XL] EvansC:
Edit

Working on it

#
#
#
#
#
#

function RunAdmin{
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
if ($myWindowsPrincipal.IsInRole($adminRole)){}Else{
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
$newProcess.Verb = "runas";
[System.Diagnostics.Process]::Start($newProcess);
}
if (!(Get-EventLog -LogName Application -Source "ECs Evita Utility")) {
New-EventLog –LogName Application –Source “ECs Evita Utility”
}
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Starting Script.”
FnFCheck
}
function FnFCheck {
$Folders = @(
".\ADB";
".\Backup";
".\Backup\Applications";
".\Backup\Camera";
".\Backup\Documents";
".\Backup\Downloads";
".\Backup\Pictures";
".\Downloads";
".\Downloads\ADK";
".\Downloads\Drivers";
".\FB";
".\Install";
".\Install\Applications";
".\Install\Boot";
".\Install\Drivers";
".\Install\HBoot";
".\Install\Recovery";
".\Install\ROM";
".\Install\S-Off";
".\Install\Unlock"
)
$Files = @(
".\ADB\adb.exe";
".\ADB\AdbWinApi.dll";
".\ADB\AdbWinUsbApi.dll";
".\FB\AdbWinApi.dll";
".\FB\AdbWinUsbApi.dll";
".\FB\fastboot.exe";
)
foreach ($Folder in $Folders){
if (!(Test-Path $Folder -pathType container)){
Write-Host $Folder -NoNewline; Write-Host " Does Not Exist!" -ForegroundColor Yellow
New-Item $Folder -Type Directory
}
}
foreach ($File in $Files){
if (!(Test-Path $File)){
Write-Host $File -NoNewline; Write-Host " Does Not Exist!" -ForegroundColor Red
Write-Host
}
}
MainMenu
}
function SDKDownload {
$AndroidSDK = "http://dl.google.com/android/adt/adt-bundle-windows-x86_64-20130729.zip"
$ADKDL = ".\Downloads\ADK\adt-bundle-windows-x86_64-20130729.zip"
if (!(Test-Path $ADKDL)){
$WC = New-Object System.Net.WebClient
Write-Host "Downloading Android Development Kit v.20130729" -ForegroundColor Green
Write-Host "Please Wait..."
$WC.DownloadFile($AndroidSDK, $ADKDL)
}
}
function MainMenu {
Clear-Host
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering Main Menu.”
Clear-Variable $MM
Clear-Host
Write-Host "Welcome to ECs Evita Utility"
Write-Host
Write-Host "Main Menu"
Write-Host
Write-Host "Enter [A] to go to ADB"
Write-Host "Enter [F] to go to FastBoot"
Write-Host "Enter [U] to go to Utilities"
Write-Host "Enter [E] to Exit"
$MM=Read-Host "Enter Selection"
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving Main Menu.”
If ($MM -eq "A"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB.”
ADB
}
If ($MM -eq "F"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot.”
FastBoot
}
If ($MM -eq "U"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected Utilities.”
Utilities
}
}
Until ($MM -eq "E")
ExitMenu
}
function ADB {
$ADBE = ".\ADB\adb.exe"
Clear-Host
&$ADBE start-server
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering ADB Menu.”
Clear-Variable $ADBM
Clear-Host
Write-Host "ECs Evita Utility"
Write-Host
&$ADBE devices -l
Write-Host
Write-Host "ADB Menu"
Write-Host
Write-Host "Enter [1] to go to "
Write-Host "Enter [2] to go to "
Write-Host "Enter [3] to go to "
Write-Host "Enter [4] to go to "
Write-Host "Enter [5] to go to "
Write-Host "Enter [6] to go to "
Write-Host "Enter [7] to go to "
Write-Host "Enter [8] to go to "
Write-Host "Enter [9] to go to "
Write-Host "Enter [E] to Exit"
$ADBM=Read-Host "Enter Selection"
If ($ADBM -eq "1"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 1.”
ADB1
}
If ($ADBM -eq "2"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 2.”
ADB2
}
If ($ADBM -eq "3"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 3.”
ADB3
}
If ($ADBM -eq "4"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 4.”
ADB4
}
If ($ADBM -eq "5"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 5.”
ADB5
}
If ($ADBM -eq "6"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 6.”
ADB6
}
If ($ADBM -eq "7"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 7.”
ADB7
}
If ($ADBM -eq "8"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 8.”
ADB8
}
If ($ADBM -eq "9"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected ADB 9.”
ADB9
}
}
Until($ADBM -eq "E")
&$ADBE kill-server
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving ADB Menu.”
}
function ADB1 {
Clear-Host
Write-Host ADB1 Selected
sleep 2
}
function ADB2 {
Clear-Host
Write-Host ADB2 Selected
sleep 2
}
function ADB3 {
Clear-Host
Write-Host ADB3 Selected
sleep 2
}
function ADB4 {
Clear-Host
Write-Host ADB4 Selected
sleep 2
}
function ADB5 {
Clear-Host
Write-Host ADB5 Selected
sleep 2
}
function ADB6 {
Clear-Host
Write-Host ADB6 Selected
sleep 2
}
function ADB7 {
Clear-Host
Write-Host ADB7 Selected
sleep 2
}
function ADB8 {
Clear-Host
Write-Host ADB8 Selected
sleep 2
}
function ADB9 {
Clear-Host
Write-Host ADB9 Selected
sleep 2
}
function FastBoot {
Clear-Host
Do{
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Entering FastBoot Menu.”
Clear-Variable $FBM
Clear-Host
Write-Host "ECs Evita Utility"
Clear-Host
Write-Host "FastBoot Menu"
Write-Host
Write-Host "Enter [1] to go to "
Write-Host "Enter [2] to go to "
Write-Host "Enter [3] to go to "
Write-Host "Enter [4] to go to "
Write-Host "Enter [5] to go to "
Write-Host "Enter [6] to go to "
Write-Host "Enter [7] to go to "
Write-Host "Enter [8] to go to "
Write-Host "Enter [9] to go to "
Write-Host "Enter [E] to Exit"
$FBM=Read-Host "Enter Selection"
If ($FBM -eq "1"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 1.”
FB1
}
If ($FBM -eq "2"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 2.”
FB2
}
If ($FBM -eq "3"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 3.”
FB3
}
If ($FBM -eq "4"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 4.”
FB4
}
If ($FBM -eq "5"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 5.”
FB5
}
If ($FBM -eq "6"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 6.”
FB6
}
If ($FBM -eq "7"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 7.”
FB7
}
If ($FBM -eq "8"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 8.”
FB8
}
If ($FBM -eq "9"){
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 2 –Message “Selected FastBoot 9.”
FB9
}
}
Until($FBM -eq "E")
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Leaving FastBoot Menu.”
}
function FB1 {
Clear-Host
Write-Host FB1 Selected
sleep 2
}
function FB2 {
Clear-Host
Write-Host FB2 Selected
sleep 2
}
function FB3 {
Clear-Host
Write-Host FB3 Selected
sleep 2
}
function FB4 {
Clear-Host
Write-Host FB4 Selected
sleep 2
}
function FB5 {
Clear-Host
Write-Host FB5 Selected
sleep 2
}
function FB6 {
Clear-Host
Write-Host FB6 Selected
sleep 2
}
function FB7 {
Clear-Host
Write-Host FB7 Selected
sleep 2
}
function FB8 {
Clear-Host
Write-Host FB8 Selected
sleep 2
}
function FB9 {
Clear-Host
Write-Host FB9 Selected
sleep 2
}
function Utilities {
Clear-Host
Write-Host "ECs Evita Utility"
Clear-Host
Write-Host "This is Utilities Menu"
Sleep 5
}
function ExitMenu {
Clear-Host
Write-Host "ECs Evita Utility"
Write-Host
Write-Host "Good Bye!"
Write-EventLog –LogName Application –Source “ECs Evita Utility” –EntryType Information –EventID 1 –Message “Exiting Script.”
Sleep 5
exit
}
RunAdmin