Upload
christophe-villeneuve
View
479
Download
0
Embed Size (px)
Citation preview
JDLL – 3 Avril 2016
Contrôler votre matériel par les Apps
JDLL – 3 Avril 2016
Christophe Villeneuve@hellosct1
JDLL – 3 Avril 2016
Qui ???
Christophe Villeneuve
JDLL – 3 Avril 2016
Aujourd'hui...
● Il parle de quoi ? Matériels / OS / Autres● 42…. ● Non…. 31 Apps● Les possibilités● Et moi !!! Et moi !!!
Matériels / OS / Autres
JDLL – 3 Avril 2016
Contrôler votre matériel par les Apps
JDLL – 3 Avril 2016
Christophe Villeneuve@hellosct1
Sécurité / Protections
JDLL – 3 Avril 2016
Liste des webApps dispo (1/2)
● Bluetooth● Mobile Connecté API● Dworkin Information
API● Dworkin stars API● TCP Socket API● Phonolite● Web SMS
● Ambient Light Sensor API
● Battery status API● Camera API● Geolocalisation API● Pointer Lock API● Power Management API● Proximity API● Device Orientation API
API Communication API Matériels
JDLL – 3 Avril 2016
Liste des webApps dispo (2/2)
● Contacts API● Device Storage API● FileHandle API● IndexedDB● Settings API
● Alarm API● Apps API● Browser API● Idle API● Permissions API● Simple Push API● Time/clock API● Web Activités● WebPayment API
API de gestion des données API Autres
Applications
42
Aujourd'hui : Plus de 30 AppsAujourd'hui : Plus de 30 Apps
JDLL – 3 Avril 2016
Téléphone
- Multitouch- WebTelephony- WebSMS- Geolocalisation- Battery API- WebNFC- WebVibration
- WebContacts- FullScreen API- Settings API- WebUSB- Camera- WebBluetooth- WebGL
JDLL – 3 Avril 2016
Alimentation : Battery
● HTML 5● Source importante pour un site web● Avoir des informations sur le matériel des visiteurs
– Combien de batterie il vous reste
– Si vous utilisez un système mobile :
Smartphone, Tablette, Ordinateur portable
● But : économiser votre batterie● Valider par W3C
JDLL – 3 Avril 2016
Battery Manager (1/2)
● Propriétés Disponible● Obtenir les informations sur le niveau de charge● Possibilité d'intéragir avec l'API d'état de la batterie● 4 fonctions importantes
https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
JDLL – 3 Avril 2016
Battery Manager (2/2)
● Statut de la batterie
BatteryManager.charging
● Temps restant de chargement (en secondes) → 100 %
BatteryManager.chargingTime
● Temps restant avant que la batterie soit décharger
BatteryManager.dischargingTime
● Niveau de la batterie (valeur entre 0 et 1.0)
BatteryManager.levelhttps://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
JDLL – 3 Avril 2016
Battery Manager : Résultat
JDLL – 3 Avril 2016
Espionnage / Surveillance / Vie Privée
● Les données des batteries peuvent être utiliser pour vous traquer
● 2 informations (dispo toutes les 30 secondes) : – Le niveau de charge de votre batterie en pourcentage
– Le temps restant avant que votre batterie ne soit entièrement vide
● Alertes des chercheurs de sécurité– Pas de validations et de confirmations
JDLL – 3 Avril 2016
ExempleVotre Ordinateur
Identifier votremachine
Identifier votremachine
Résultat : Savoir quels sites vous visitez simultanément
→ Ces données pourront ensuite être exploitée
JDLL – 3 Avril 2016
Résumé
● Une solution– Un choix
Matériels / OS / Autres
JDLL – 3 Avril 2016
Pourquoi ?
● Code réutilisable● Code libre (Freedom)● Firefox OS est juste pour le web
API Spécifiques
JDLL – 3 Avril 2016
Api spécifique Téléphone / Tablette
● Connection blueTooth● Mode vibration● Accès à la géolocalisation● Contacts
JDLL – 3 Avril 2016
API Spécifique : Périphériques
● Fonctionnalité JS
Element.addEventListener
● But : manière d'enregistrer un écouteur telle que spécifiée dans le DOM du W3C
● Ecoute : – Souris : mouse…
– Batterie : chargingchange
– Orientation : deviceorientation
– ...
JDLL – 3 Avril 2016
Connecteurs
● Tactiles – Touch events
● Joystick
● GamePadhttps://developer.mozilla.org/en-US/docs/Web/Guide/API/Gamepad
● Souris
● Télécommande
JDLL – 3 Avril 2016
Connecteurs : Exemple « jeu » 1/2
● Captain Rogers
● Jouabilité
JDLL – 3 Avril 2016
Connecteurs : Exemple « jeu » 2 / 2
window.addEventListener("keydown", function(evt) { console.log(evt.keyCode);}, this);
window.addEventListener("touchstart", function(evt) { console.log(evt.keyCode);}, this);
JDLL – 3 Avril 2016
Manette de jeu USB
function keydown(ev){ if (!ev) ev = event; if (game) { if ((ev.keyCode == 37)||(ev.keyCode == 65)) game.turnShip(0.1); if ((ev.keyCode == 39)||(ev.keyCode == 68)) game.turnShip(-0.1); if ((ev.keyCode == 38)||(ev.keyCode == 87)) game.boostShip(10); if (ev.keyCode == 32) game.shipFire(); if (ev.keyCode == 13) game.startGame(); }}
JDLL – 3 Avril 2016
API Spécifique : IoT Proximité
● Détection :
element.addEventListener('deviceproximity')
● Communiqué avec d'autres appareils● Contrôle à distance
JDLL – 3 Avril 2016
API Proximité Exemple 1
● Son / Musique
JDLL – 3 Avril 2016
Exemple 1 Utilisation
● Web API audio
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
source = audioCtx.createMediaStreamSource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadFilter); biquadFilter.connect(gainNode); gainNode.connect(audioCtx.destination);
JDLL – 3 Avril 2016
API Proximité Exemple 2
● Tablette / Ecran / Projection
JDLL – 3 Avril 2016
Exemple 2 Utilisation
● Voir slides précédents
Au niveau DEV
JDLL – 3 Avril 2016
Technologies Web
● Technologies Web– HTML 5 / CSS 3
● Script– Javascript / Web API
● Graphique– SVG / WebGL
● Autre– MathML
JDLL – 3 Avril 2016
WebApps
● Disponible depuis de 1.0● Script manifest
{ "name": "Mon application", "description": "Une description courte de l'application", "launch_path": "/", "icons": { "128": "/img/icone-128.png" }, "developer": { "name": "Votre nom ou celle de votre organisation", "url": "http://votre-site-web.org" }, "default_locale": "fr"}
JDLL – 3 Avril 2016
Add-ons
● Dispo à partir de Firefox OS 2.5
{ "manifest_version": 1, "name": "Add-on banner", "description": "Firefox OS add-on example", "version": "1.0", "author": "Chris Mills", "content_scripts": [{ "matches": ["app://system.gaiamobile.org/index.html"], "css": ["css/style.css"], "js": ["js/index.js"] }], "icons": { "128": "/icons/128.png" }
JDLL – 3 Avril 2016
Compatibilité
● Apache Cordova (PhoneGap)– Au niveau compatibilité iOS et Android
JDLL – 3 Avril 2016
Hors ligne
● La gestion de CACHE est deprecated● Service workers API
https://developer.mozilla.org/fr/docs/Web/API/Service_Worker_API
Sécurité / Protections
JDLL – 3 Avril 2016
Protection
● Navigation Privée● Do Not Track
JDLL – 3 Avril 2016
Permissions
● Autorisation● Les Applications qui demandent des accès ???
– Contacts
– Géolocalisations
– Etc..
JDLL – 3 Avril 2016
Sécurité : OWASP Top 10 IoT
https://www.owasp.org/index.php/OWASP_Internet_of_Things_Project
● 1-Insecure Web Interface● 2-Insufficient Authentication/Authorization● 3-Insecure Network Services● 4-Lack of Transport Encryption● 5-Privacy Concerns● 6-Insecure Cloud Interface● 7-Insecure Mobile Interface● 8-Insufficient Security Configurability● 9-Insecure Software/Firmware● 10-Poor Physical Security
JDLL – 3 Avril 2016
Ressources
● Guides pour développeur web– https://developer.mozilla.org/fr/docs/Web/Guide
● Tutoriels pour développeurs Web– https://developer.mozilla.org/fr/docs/Web/Tutoriels
● Hacks Mozilla
– http://hacks.mozilla.org● Webapp API
– https://developer.mozilla.org/fr/docs/WebAPI
JDLL – 3 Avril 2016
Comparateur HTML 5 / Mobile
JDLL – 3 Avril 2016
Internet des Objets (iOT)
● CyanogenMod– Fork de AOSP et CAF (Code Aurora)
● Licence Free● Modifie le device et le Kernel pour Firefox OS● Disponiblehttps://github.com/cm-b2g/B2G.git
JDLL – 3 Avril 2016
Portage 1/2
● pour Android ● Pour Mac
● Modèle● Portage OS Mobilehttps://github.com/mozilla-b2g
JDLL – 3 Avril 2016
Portage 2/2
● Arduino
● Raspberry PI et PI2● Chirimenprochainement
JDLL – 3 Avril 2016
Autre
● TV Panasonic ● OS :
Ronin Web Desktop
Merci
Questions
Christophe Villeneuve@hellosct1
http://firefoxos.mozfr.orghttp://www.mozfr.org