-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreen_unlock.pl
43 lines (37 loc) · 2.16 KB
/
screen_unlock.pl
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
##############################################################################
#****************************Author: Darragh Merrick*************************#
#******************************created: 10/04/2013***************************#
#*****************************Android Screen Unlock**************************#
##############################################################################
#use strict;
use warnings;
print " \n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of \n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The author \n will be in no way liable for any damages to devices or loss of data \n that may occur.\n";
print " \n Please connect Android device now ...\n";
$num = 2; # A delay to give user a chance to read greeting.
while($num--){
sleep(1);
}
my $kill =`adb wait-for-device`; # Ensure graceful start.
my $con1 = `adb devices`; # Connect to android device and display serial.
my @con2 = split(" ", $con1);
print " \n @con2 \n";
if($con2[5] !~ /device/) { # This process troubleshoots no adb connection (when adb is turned off)!
print "\n No adb connection! \n Please check that usb is connected to the device and that adb is enabled on it.";
print "\n The local machine has a valid adb vendor list in location /etc/udev/rules.d/51-android.rules\n";
print "\n Execute 'lsusb' command from Linux terminal to show connected usb devices\n";
goto error; }
if($con2[5] =~ /device/) {
print "\n adb device successfully connected :-) \n";
}
my $install = `adb install AntiGuard/AntiGuard.apk`; #To install AntiGuard run this command
my $start = `adb shell su -c "am start -n io.kos.antiguard/.unlock"`; #To unlock the screen start the program
print "\n To return to main menu >Press 1 \n To finish program now > Press 2 \n";
my $choice = <STDIN>; #The program chosen by the user.
chomp $choice;
if ($choice == 1 ) {
my $Script1 =system("/usr/bin/perl Android_Script_Menu.pl ");
}
else {
print " \n Goodbye :-) \n";
}
#my uninstall = adb uninstall io.kos.antiguard #To uninstall run this command