<project version="4">
<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
- <change afterPath="$PROJECT_DIR$/cache-polyfill.js" afterDir="false" />
+ <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$/js/webapp.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/webapp.js" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/manifest.php" beforeDir="false" afterPath="$PROJECT_DIR$/manifest.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$/service-worker.js.template" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1603095373591" duration="1368000" />
<workItem from="1603270756890" duration="3366000" />
<workItem from="1603558842019" duration="15438000" />
- <workItem from="1603646440968" duration="3050000" />
- </task>
- <task id="LOCAL-00306" summary=".">
- <created>1582220578115</created>
- <option name="number" value="00306" />
- <option name="presentableId" value="LOCAL-00306" />
- <option name="project" value="LOCAL" />
- <updated>1582220578115</updated>
+ <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="project" value="LOCAL" />
<updated>1603643895376</updated>
</task>
- <option name="localTasksCounter" value="355" />
+ <task id="LOCAL-00355" summary=".">
+ <created>1603650334848</created>
+ <option name="number" value="00355" />
+ <option name="presentableId" value="LOCAL-00355" />
+ <option name="project" value="LOCAL" />
+ <updated>1603650334849</updated>
+ </task>
+ <option name="localTasksCounter" value="356" />
<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="1603643887312">
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2" timestamp="1603650331491">
<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="1603643887312" />
- <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1603637447680">
+ <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1603650331491" />
+ <state x="1114" y="443" key="NewPhpFileDialog" timestamp="1603958673068">
<screen x="0" y="0" width="2560" height="1040" />
</state>
- <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1603637447680" />
+ <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1603958673068" />
<state x="781" y="165" key="SettingsEditor" timestamp="1596008871908">
<screen x="0" y="0" width="2560" height="1040" />
</state>
--- /dev/null
+<?php
+define('SHIELD_HOST', '192.168.13.40');
+$shieldConnect = false;
+
+function shieldConnect()
+{
+ global $shieldConnect;
+ if (!$shieldConnect) {
+ _adb('start-server');
+ _adb('connect', SHIELD_HOST);
+ }
+}
+
+function shieldCommand($command, $params)
+{
+ shieldConnect();
+ _adb($command, $params);
+}
+
+function shieldKey($key)
+{
+ $map = ['right' => 22, 'up' => 19, 'left' => 21, 'down' => 20, 'ok' => 23, 'space' => 32];
+ if (isset($map[$key])) {
+ $key = $map[$key];
+ }
+ shieldCommand('shell', 'input keyevent ' . $key);
+}
+
+function shieldNetflix($id)
+{
+ $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');
+}
+
+function _adb($command, $params = '')
+{
+ $c = 'adb ' . $command;
+ if ($params) {
+ $c .= ' ' . $params;
+ }
+ echo $c . ' :: ' . `$c` . "\n";
+}
\ No newline at end of file
console.info('All files are cached');
return self.skipWaiting(); //To forces the waiting service worker to become the active service worker
})
- .catch((error) => {
+ .catch((error) => {
console.error('Failed to cache', error);
})
})
var request = event.request;
var url = new URL(request.url);
- if (url.origin === location.origin) {
- // Static files cache
- event.respondWith(cacheFirst(request));
- } else {
- // Dynamic API cache
+ // if (url.origin === location.origin) {
+ // // Static files cache
+ // event.respondWith(cacheFirst(request));
+ // } else {
+ // // Dynamic API cache
+ try {
event.respondWith(networkFirst(request));
+ } catch (e) {
+ console.log(e);
}
+// }
// // Checking for navigation preload response
// if (event.preloadResponse) {