]> _ Git - tortuga-home.git/commitdiff
.
authorvincent <vincent@enhydra.fr>
Tue, 8 Mar 2022 14:27:06 +0000 (15:27 +0100)
committervincent <vincent@enhydra.fr>
Tue, 8 Mar 2022 14:27:06 +0000 (15:27 +0100)
.idea/workspace.xml
config/tv.php
scripts/lib/shield.php
scripts/shield.php

index 84d19f42d5c696e032ca3f50cfd8477e98509309..8e401c3cc2e727e6713c7d9e10759ab5b90c77f0 100644 (file)
@@ -3,8 +3,9 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/gradient.php" beforeDir="false" afterPath="$PROJECT_DIR$/gradient.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/tv.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/tv.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" />
       <workItem from="1644683361342" duration="9446000" />
       <workItem from="1645044938023" duration="1854000" />
       <workItem from="1645812379443" duration="615000" />
-      <workItem from="1646485258542" duration="84000" />
-    </task>
-    <task id="LOCAL-00469" summary=".">
-      <created>1618861174900</created>
-      <option name="number" value="00469" />
-      <option name="presentableId" value="LOCAL-00469" />
-      <option name="project" value="LOCAL" />
-      <updated>1618861174900</updated>
+      <workItem from="1646485258542" duration="4443000" />
     </task>
     <task id="LOCAL-00470" summary=".">
       <created>1618909856303</created>
       <option name="project" value="LOCAL" />
       <updated>1644764168580</updated>
     </task>
-    <option name="localTasksCounter" value="518" />
+    <task id="LOCAL-00518" summary=".">
+      <created>1646485378809</created>
+      <option name="number" value="00518" />
+      <option name="presentableId" value="LOCAL-00518" />
+      <option name="project" value="LOCAL" />
+      <updated>1646485378810</updated>
+    </task>
+    <option name="localTasksCounter" value="519" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index fda8ca8b60b22ef2babf5060991a6c2c78f5d21a..4503421e23d2ccd57c0a164bbe33ef46648907e0 100644 (file)
@@ -46,6 +46,7 @@ foreach ($replays as $name => $replay) {
 }
 
 $tv = array(
+    'Connexion MyCanal' => array('freebox' => 'replay', 'shield' => 'mycanal:connect:home'),
     'Replay' => array('freebox' => 'replay', 'shield' => 'mycanal:replay:home'),
     'Netflix' => array('freebox' => 'netflix', 'shield' => 'netflix:home'),
     'Infos',
index 5f239af8571a43dcd26575d870c92644a4253161..4395bd54804c5ce00df968a22a39948faf3fd603 100644 (file)
@@ -178,10 +178,41 @@ function shieldLaunchApp($activity, $device = null)
     }
 }
 
+function shieldMyCanalConnect($device = null, $force = false)
+{
+    $d = getDevice($device);
+    $state = 'mycanallastconnect_' . $d['id'];
+    $limit = time() - 3600 * 24 * 2;
+    if (!$force && getState($state, 0) > $limit) {
+        return;
+    }
+    shieldClearAppData('mycanal', $device);
+    shieldLaunchApp('mycanal', $device);
+    sleep(7);
+    shieldKey(['ok'], $device);
+    sleep(4);
+    shieldKey(['down', 'down', 'ok', 'down', 'ok'], $device);
+    sleep(3);
+    shieldText('fbx18439571', $device);
+    shieldKey(['back', 'down'], $device);
+    shieldText('paogaiho', $device);
+    shieldKey(['back', 'ok']);
+    sleep(11);
+    shieldKey(['down', 'ok', 'up', 'ok']);
+    setState($state, time());
+    sleep(5);
+    return true;
+}
+
 function shieldMyCanal($channel = false, $type = 'live', $device = null)
 {
     shieldRunActivity($device);
-    shieldKill('mycanal', $device);
+    if ($type === 'connect') {
+        return shieldMyCanalConnect($device, true);
+    } else {
+        shieldMyCanalConnect($device);
+    }
+
     if ($type === 'replay') {
         if ($channel === 'arte') {
             shieldArte($device);
@@ -199,8 +230,9 @@ function shieldMyCanal($channel = false, $type = 'live', $device = null)
     }
 
     setPlaying('mycanal', $device);
+    shieldKill('mycanal', $device);
     shieldHome($device);
-    shieldCommand('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.app.common.legacy.DeepLinkActivity', $device);
+    return shieldCommand('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.mycanal.legacy.DeepLinkActivity', $device);
 }
 
 function shieldKodi($file, $device = null)
@@ -236,8 +268,8 @@ function shieldListApps($device = null)
 function shieldFindIntents($app, $device = null)
 {
     $app = shieldGetAppId($app);
-    shieldCommand('shell pm dump', $app, $device);
-    shieldCommand('shell pm dump', $app . ' | grep -A 1 "MAIN" | grep ' . $app . ' | awk \'{print $2}\' | grep ' . $app, $device);
+    echo shieldCommand('shell pm dump', $app, $device);
+    echo shieldCommand('shell pm dump', $app . ' | grep -A 1 "MAIN" | grep ' . $app . ' | awk \'{print $2}\' | grep ' . $app, $device);
 }
 
 function shieldGetAppId($id = null)
@@ -362,12 +394,16 @@ function shieldGetCurrentApp($device = null)
     return null;
 }
 
+function shieldClearAppData($app, $device = null)
+{
+    return shieldCommand('shell pm clear', shieldGetAppId($app));
+}
 
 function _adb($command, $params = '', $device = null)
 {
     $c = _adbcmd($command, $params, $device);
     $output = `$c`;
-    // echo $c . ' :: ' . $output . "\n";
+    //echo $c . ' :: ' . $output . "\n";
     return $output;
 }
 
index 7966ec5587a81d7998a36275c2f3809f8a112354..2696577a8d75444f469ff9e78ca5526bb92efc19 100644 (file)
@@ -24,8 +24,10 @@ if (isset($_GET['key'])) {
     shieldKodi($_GET['kodi'], $device);
 } else if (isset($_GET['mycanal'])) {
     $e = explode(':', $_GET['mycanal']);
-    shieldMyCanal($e[1], $e[0], $device);
+    echo shieldMyCanal($e[1], $e[0], $device);
 } else if (isset($_GET['runappback'])) {
     shieldRunAppAndBackHome($_GET['runappback'], $device);
+} else if (isset($_GET['clear'])) {
+    echo shieldClearAppData($_GET['clear'], $device);
 }
 echo '</pre>';
\ No newline at end of file