]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sat, 31 Oct 2020 11:18:45 +0000 (12:18 +0100)
committerVincent <vincent@enhydra.fr>
Sat, 31 Oct 2020 11:18:45 +0000 (12:18 +0100)
.idea/workspace.xml
config/global.php
scripts/lib/shield.php
scripts/shield.php

index 92979e7e24e39f984034df703334109b91d05d4c..e1541d381c9b6a6f2dabae8ff5a76b4630086a5a 100644 (file)
@@ -2,12 +2,10 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
-      <change afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/service-worker.js" beforeDir="false" afterPath="$PROJECT_DIR$/service-worker.js" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/global.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/global.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1603558842019" duration="15438000" />
       <workItem from="1603646440968" duration="3909000" />
       <workItem from="1603811262372" duration="1988000" />
-      <workItem from="1603958541180" duration="2708000" />
-    </task>
-    <task id="LOCAL-00307" summary=".">
-      <created>1582798632124</created>
-      <option name="number" value="00307" />
-      <option name="presentableId" value="LOCAL-00307" />
-      <option name="project" value="LOCAL" />
-      <updated>1582798632124</updated>
+      <workItem from="1603958541180" duration="5032000" />
+      <workItem from="1604042543878" duration="5459000" />
     </task>
     <task id="LOCAL-00308" summary=".">
       <created>1583065717346</created>
       <option name="project" value="LOCAL" />
       <updated>1603650334849</updated>
     </task>
-    <option name="localTasksCounter" value="356" />
+    <task id="LOCAL-00356" summary=".">
+      <created>1603961859961</created>
+      <option name="number" value="00356" />
+      <option name="presentableId" value="LOCAL-00356" />
+      <option name="project" value="LOCAL" />
+      <updated>1603961859962</updated>
+    </task>
+    <option name="localTasksCounter" value="357" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="872" y="161" key="#Plugins/0.0.2560.1040@0.0.2560.1040" timestamp="1596008801840" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603650331491">
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603961854066">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603650331491" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603961854066" />
     <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1603958673068">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1603559077781" />
+    <state x="90" y="196" width="672" height="678" key="search.everywhere.popup" timestamp="1604043317166">
+      <screen x="0" y="0" width="1707" height="920" />
+    </state>
+    <state x="90" y="196" width="672" height="678" key="search.everywhere.popup/0.0.1707.920@0.0.1707.920" timestamp="1604043317166" />
   </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
index 7a6b7eebfb6dbe2b43323917b65d5c8605d718ce..1db5c5697fc5f6183074d4cca7c091266044dddf 100644 (file)
@@ -15,7 +15,8 @@ define('LONGITUDE', 2.3422104);
 
 $squeezeboxPlayers = array(
     'Salle de bains' => 'b8:27:eb:ab:b4:50',
-    'Salon' => 'dc:a6:32:02:47:c1',
+    //'Salon' => 'dc:a6:32:02:47:c1',
+    'Salon' => 'cc:cc:2d:15:82:0e',
     'Chambre' => 'b8:27:eb:31:e1:44',
     'WC' => '00:04:20:2a:05:2e',
     'Cuisine' => 'b8:27:eb:ec:71:34',
index 5355177b7d6fe5f089c2292b9cb959b4bdac90c0..a3f9f8a7a6584b13eccd42beaa7b4d9eea1f600d 100644 (file)
@@ -6,8 +6,9 @@ function shieldConnect()
 {
     global $shieldConnect;
     if (!$shieldConnect) {
-        _adb('start-server');
-        _adb('connect', SHIELD_HOST);
+        //_adb('kill-server');
+        //_adb('start-server');
+        //_adb('connect', SHIELD_HOST);
     }
 }
 
@@ -17,21 +18,77 @@ function shieldCommand($command, $params)
     _adb($command, $params);
 }
 
+function shieldText($text)
+{
+    shieldCommand('shell', 'input text ' . $text);
+}
+
 function shieldKey($key)
 {
-    $map = ['right' => 22, 'up' => 19, 'left' => 21, 'down' => 20, 'ok' => 23, 'space' => 32];
+    $map = ['right' => 'KEYCODE_DPAD_RIGHT',
+        'up' => 'KEYCODE_DPAD_UP',
+        'left' => 'KEYCODE_DPAD_LEFT',
+        'down' => 'KEYCODE_DPAD_DOWN',
+        'wakeup' => 'KEYCODE_WAKEUP',
+        'sleep' => 'KEYCODE_SLEEP',
+        'enter' => 'KEYCODE_ENTER',
+        'ok' => 'KEYCODE_ENTER',
+        'back' => 'KEYCODE_BACK',
+        'home' => 'KEYCODE_HOME',
+        'play' => 'KEYCODE_MEDIA_PLAY',
+        'pause' => 'KEYCODE_MEDIA_PAUSE',
+        'stop' => 'KEYCODE_MEDIA_STOP',
+    ];
     if (isset($map[$key])) {
         $key = $map[$key];
     }
     shieldCommand('shell', 'input keyevent ' . $key);
 }
 
-function shieldNetflix($id)
+function shieldNetflix($id = null)
+{
+    shieldHome();
+    $url = 'http://www.netflix.com/';
+    if (null !== $id) {
+        $url .= 'watch/' . $id;
+    }
+    //_adb('shell am start', ' -c android.intent.category.LEANBACK_LAUNCHER -a android.intent.action.VIEW -f 0x10808000 -e source 30 -d ' . $url . ' com.netflix.ninja/.MainActivity');
+    _adb('shell am start', ' -c android.intent.category.LEANBACK_LAUNCHER -a android.intent.action.VIEW -f 0x10808000 -e source 30 -d ' . $url . ' com.netflix.ninja/.MainActivity');
+}
+
+function shieldTVChannel()
+{
+
+}
+
+function shieldListApps()
 {
-    $url = 'http://www.netflix.com/watch/' . $id;
-    _adb('shell am start', ' -c android.intent.category.LEANBACK_LAUNCHER -a android.intent.action.VIEW  -f 0x10808000 -e source 30 -d ' . $url . ' com.netflix.ninja/.MainActivity');
+    _adb('shell pm list', 'packages -f');
 }
 
+function shieldFindIntents($app)
+{
+    $apps = ['netflix' => 'com.netflix.ninja', 'mycanal' => 'com.canal.android.canal'];
+    $app = $apps[$app];
+    _adb('shell pm dump', $app . ' | grep -A 1 "MAIN" | grep ' . $app . ' | awk \'{print $2}\' | grep ' . $app);
+}
+
+function shieldHome()
+{
+    $res = shieldKey('home');
+    usleep(0.5 * 1000000);
+    return $res;
+}
+
+function shieldKill()
+{
+    $tokill = ['com.netflix.ninja'];
+    foreach ($tokill as $item) {
+        _adb('shell am', 'force-stop ' . $item);
+    }
+}
+
+
 function _adb($command, $params = '')
 {
     $c = 'adb ' . $command;
index 8bbcdf657479569f68e98a5c9fa0368a1d4fc793..65d331b6bc553384cf80b9df1d8b3c185bdef9ab 100644 (file)
@@ -7,5 +7,11 @@ if (isset($_GET['key'])) {
     shieldKey($_GET['key']);
 } else if (isset($_GET['netflix'])) {
     shieldNetflix($_GET['netflix']);
+} else if (isset($_GET['text'])) {
+    shieldText($_GET['text']);
+} else if (isset($_GET['action'])) {
+    if ($_GET['action'] == 'apps') {
+        shieldListApps();
+    }
 }
 echo '</pre>';
\ No newline at end of file