diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..d6a585c --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/html.iml b/.idea/html.iml new file mode 100644 index 0000000..ef8e489 --- /dev/null +++ b/.idea/html.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..9f737c1 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e5e05d2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..402a4b5 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 0000000..27a23e1 --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b990755 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1606346468032 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ADBKeyCodes.php b/ADBKeyCodes.php new file mode 100644 index 0000000..b375267 --- /dev/null +++ b/ADBKeyCodes.php @@ -0,0 +1,90 @@ + 0, +// "MENU" => 1, + "SOFT_RIGHT" => 2, + "HOME" => 3, + "BACK" => 4, + "CALL" => 5, +// "ENDCALL" => 6, + "0" => 7, + "1" => 8, + "2" => 9, + "3" => 10, + "4" => 11, + "5" => 12, + "6" => 13, + "7" => 14, + "8" => 15, + "9" => 16, + "STAR" => 17, + "POUND" => 18, + "DPAD_UP" => 19, + "DPAD_DOWN" => 20, + "DPAD_LEFT" => 21, + "DPAD_RIGHT" => 22, + "DPAD_CENTER" => 23, + "VOLUME_UP" => 24, + "VOLUME_DOWN" => 25, + "POWER" => 26, + "CAMERA" => 27, + "CLEAR" => 28, + "A" => 29, + "B" => 30, + "C" => 31, + "D" => 32, + "E" => 33, + "F" => 34, + "G" => 35, + "H" => 36, + "I" => 37, + "J" => 38, + "K" => 39, + "L" => 40, + "M" => 41, + "N" => 42, + "O" => 43, + "P" => 44, + "Q" => 45, + "R" => 46, + "S" => 47, + "T" => 48, + "U" => 49, + "V" => 50, + "W" => 51, + "X" => 52, + "Y" => 53, + "Z" => 54, + "COMMA" => 55, + "PERIOD" => 56, + "ALT_LEFT" => 57, + "ALT_RIGHT" => 58, + "SHIFT_LEFT" => 59, + "SHIFT_RIGHT" => 60, + "TAB" => 61, + "SPACE" => 62, + "SYM" => 63, + "EXPLORER" => 64, + "ENVELOPE" => 65, + "ENTER" => 66, + "DEL" => 67, + "GRAVE" => 68, + "MINUS" => 69, + "EQUALS" => 70, + "LEFT_BRACKET" => 71, + "RIGHT_BRACKET" => 72, + "BACKSLASH" => 73, + "SEMICOLON" => 74, + "APOSTROPHE" => 75, + "SLASH" => 76, + "AT" => 77, + "NUM" => 78, +// "HEADSETHOOK" => 79, + "FOCUS" => 80, + "PLUS" => 81, + "MENU" => 82, + "NOTIFICATION" => 83, + "SEARCH" => 84, + "TAG_LAST_KEYCODE" => 85, +); diff --git a/ADBService.php b/ADBService.php new file mode 100644 index 0000000..c1e9e4d --- /dev/null +++ b/ADBService.php @@ -0,0 +1,34 @@ +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]); + } +} \ No newline at end of file diff --git a/app.js b/app.js new file mode 100644 index 0000000..e69de29 diff --git a/execute.php b/execute.php new file mode 100644 index 0000000..7ddb5e0 --- /dev/null +++ b/execute.php @@ -0,0 +1,11 @@ +connect(); + +echo json_encode([$service->sendKey($axiosRequest->keyCode)]); diff --git a/index.html b/index.html new file mode 100644 index 0000000..8cbf1b8 --- /dev/null +++ b/index.html @@ -0,0 +1,102 @@ + + + + + + + + + Android TV Web Remote + + +
+
+ + + + + + OK + + + + + + +
+ + + + + + + + + + + + +
+
+ + + + + + + \ No newline at end of file diff --git a/remote.css b/remote.css new file mode 100644 index 0000000..b69277c --- /dev/null +++ b/remote.css @@ -0,0 +1,8 @@ +#remote-control { + margin: 3em auto; + max-width: 300px; +} + +.fa-1c5x { + font-size: 1.5em; +} \ No newline at end of file