Merge pull request #391 from v1nc/find-phone

New App: Find Phone - find your phone via GadgetBridge
pull/401/head
Gordon Williams 2020-05-07 16:07:57 +01:00 committed by GitHub
commit 92c517e22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 0 deletions

View File

@ -1661,5 +1661,19 @@
{"name":"beebclock.app.js","url":"beebclock.js"},
{"name":"beebclock.img","url":"beebclock-icon.js","evaluate":true}
]
},
{ "id": "findphone",
"name": "Find Phone",
"shortName":"Find Phone",
"icon": "app.png",
"version":"0.01",
"description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳",
"tags": "tool,android",
"readme": "README.md",
"allow_emulator": true,
"storage": [
{"name":"findphone.app.js","url":"app.js"},
{"name":"findphone.img","url":"app-icon.js","evaluate":true}
]
}
]

1
apps/findphone/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: First Version

9
apps/findphone/README.md Normal file
View File

@ -0,0 +1,9 @@
# Find Phone
Ring your phone via GadgetBridge if you lost it somewhere.
1. Enable HID in settings
2. Connect GadgetBridge
3. Lose phone
4. Open app
5. Click any button or screen

View File

@ -0,0 +1 @@
require("heatshrink").decompress(atob("mEwwkCkQA/AEp0JCxkgC5KJMUpYXMgf/AA0wC5sPC4/wC/4XhxAXXwQXtlBIJC5URC4QwIC5PxFgQXT/QUCC6fwC4ZgIC5E/+EYCgJ4JC4/zwfwhAXTnGIC9pHXO66nY//4a63xFYTvUiJeCC6cAOxQXNFxIXllAWIC5oAKC+EDC48wC5oAKC9EBiAXokBGJgQXLMBQWMAH4AZA="))

33
apps/findphone/app.js Normal file
View File

@ -0,0 +1,33 @@
var storage = require('Storage');
//notify your phone
function find(){
Bluetooth.println(JSON.stringify({t:"findPhone", n:true}));
}
//init graphics
g.clear();
require("Font8x12").add(Graphics);
g.setFont("8x12",3);
g.setFontAlign(0,0);
g.flip();
//init settings
const settings = storage.readJSON('setting.json',1) || { HID: false };
//check if HID enabled and show message
if (settings.HID=="kb" || settings.HID=="kbmedia") {
g.setColor(0x03E0);
g.drawString("click to find", g.getWidth()/2, g.getHeight()/2);
//register all buttons and screen to find phone
setWatch(find, BTN1);
setWatch(find, BTN2);
setWatch(find, BTN3);
setWatch(find, BTN4);
setWatch(find, BTN5);
}else{
g.setColor(0xf800);
g.drawString("enable HID!", g.getWidth()/2, g.getHeight()/2);
}

BIN
apps/findphone/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B