<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" />
{
global $shieldConnect;
if (!$shieldConnect) {
- _adb('start-server');
- _adb('connect', SHIELD_HOST);
+ //_adb('kill-server');
+ //_adb('start-server');
+ //_adb('connect', SHIELD_HOST);
}
}
_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;