You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
705 B
35 lines
705 B
<?php |
|
|
|
include_once 'ADBKeyCodes.php'; |
|
|
|
class ADBService |
|
{ |
|
const DEFAULT_HOST = '192.168.1.132'; |
|
private $host; |
|
|
|
public function __construct($host) |
|
{ |
|
$this->host = $host; |
|
$this->connect(); |
|
} |
|
|
|
public function connect() |
|
{ |
|
return $this->executeCommand('connect ' . escapeshellarg($this->host)); |
|
} |
|
|
|
public function disconnect() |
|
{ |
|
return $this->executeCommand('disconnect'); |
|
} |
|
|
|
public function executeCommand($command) |
|
{ |
|
return shell_exec('adb ' . $command); |
|
} |
|
|
|
public function sendKey($keyIdentifier) |
|
{ |
|
return $this->executeCommand(' shell input keyevent ' . ADB_KEYCODES[$keyIdentifier]); |
|
} |
|
} |