From cbfec4c523c5a44efee5088dc29194b17c9a3bfc Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Tue, 10 Sep 2024 17:31:19 +0200 Subject: [PATCH] gbdiscon: new app to disconnect from Gadgetbridge gbdiscon sends an action intent that's picked up by Gadgetbridge to disconnect the Bangle.js. It requires the Bluetooth intent API to be enabled in Gadgetbridge. The clock face is loaded immediately. --- apps/gbdiscon/ChangeLog | 1 + apps/gbdiscon/app-icon.js | 1 + apps/gbdiscon/app.js | 7 +++++++ apps/gbdiscon/app.png | Bin 0 -> 1081 bytes apps/gbdiscon/metadata.json | 13 +++++++++++++ 5 files changed, 22 insertions(+) create mode 100644 apps/gbdiscon/ChangeLog create mode 100644 apps/gbdiscon/app-icon.js create mode 100644 apps/gbdiscon/app.js create mode 100644 apps/gbdiscon/app.png create mode 100644 apps/gbdiscon/metadata.json diff --git a/apps/gbdiscon/ChangeLog b/apps/gbdiscon/ChangeLog new file mode 100644 index 00000000000..5560f00bce7 --- /dev/null +++ b/apps/gbdiscon/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/gbdiscon/app-icon.js b/apps/gbdiscon/app-icon.js new file mode 100644 index 00000000000..81bf1488463 --- /dev/null +++ b/apps/gbdiscon/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwYHEgMkyVAkmQDJYREyQRRoARQpARQpIRRkARNggRBkgRNgARCwARNiQRBSRIREgQRBSRIREgARCSRARFhKSKCIoFCSRAjISQ0BAQJZHCI6ZBTwKPEI44tBTIMSYoZ9IBIYyEWZCHEKwbXIDwZ6MBghjBWBR7DIQbmJAAJ7BexYRHGZZHEchRrGNJYRIRpARJWI7XDCIrVHLIeACIpuIgKwBR4RcQyDLFCJbLGCJcAZZgLEiRcLCIkCZZYvFCKAjDI6BZOPqD+PWaUJa6ARCTxARICBQRFPRIRHPRIRHBg4A=")) diff --git a/apps/gbdiscon/app.js b/apps/gbdiscon/app.js new file mode 100644 index 00000000000..1652ac50687 --- /dev/null +++ b/apps/gbdiscon/app.js @@ -0,0 +1,7 @@ +{ +Bangle.setUI({mode:"custom",remove:()=>{}});"Bangle.loadWidgets"; // Allow fastloading. + +Bluetooth.println(JSON.stringify({t:"intent", action:"nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_DISCONNECT", extra:{EXTRA_DEVICE_ADDRESS:NRF.getAddress()}})); + +Bangle.showClock(); +} diff --git a/apps/gbdiscon/app.png b/apps/gbdiscon/app.png new file mode 100644 index 0000000000000000000000000000000000000000..f942c9ba06957ce4fa61a9209097ebf0dea8cc03 GIT binary patch literal 1081 zcmV-91jhS`P)q$gGRCt`tm``Y2MI6V!ZLKlwW@b~{+Da7Kdax=YNWqH+g^+no znw<%}gHZ5fD8-AX;wgKHP4k;=T_}_sJa~xe4QHz6BEE{5yJ%o@p&#FOacI_KQO+{!27J{5GEmj)$j28+t-Bn zIE3iS9l&*nLjlD3R_0ANBf*tEHy|rV*MDBa=$L_6aRmqlt^g#d>S zCN^J`b0w~HXcv?E{ld838U6kSM)n2pzGwwtFS7vNd;o9N-MIM0K=>iBDY5y2U){wO zUAqTRUs5mfl9thZA*MGQh^a_4>Hs$}zB7O~YvA2-H6B3xW`8S$zXhF&Df*zne8Zvz zK6Y|2y5C^*X#?*&1M!Z5m@)8{W2DNJ8pQDs{)6a-ijrR2*!;a{(3Js2W6^UVh958x zCjy9n9G`g2M(jE!2GC9M$oK|C8k{LmuDS8RGMVXPsF z-Ic$vg)2J275&`~geiTgI7u%>kB4}Et9`lw#GOc6ylo5mPmJzGRvJ|F43qSI`;^lE za;d8j)rQL_fOx^c`_;f(Sb{i!o=8;txT2GFlWn6xKk?GsbJ61+wZm?RDLTXzoo`Pl{ZWksh8RpI2k7OtEmDE`IUaA=&~Ib zY+*;gYXMNUd%4sfxfQwo-Sdo0z0Gn9?f_1%9ol^hA0Pi2&jbhPpnc zGrzJUR{(JbL*8Ue?>#`=!B90H(|ZnZe=wAK*6Eg)`XWC<`|UNK zk^&5t^kZD6o3HW7%FC&mPXfTDp5l^jx4hJpzGO%E z)Xm2N5Y;}W=v{|=zp!1=?o7QQUVWt zO^N{ao#GYrQam9*rk$qi09kh$v`}1tG&{|I1*V;1@ZULg00000NkvXXu0mjfZ5slf literal 0 HcmV?d00001 diff --git a/apps/gbdiscon/metadata.json b/apps/gbdiscon/metadata.json new file mode 100644 index 00000000000..ba2394bfe2e --- /dev/null +++ b/apps/gbdiscon/metadata.json @@ -0,0 +1,13 @@ +{ "id": "gbdiscon", + "name": "Disconnect from Gadgetbridge", + "shortName":"Disconnect", + "version":"0.01", + "description": "Disconnect from your android device by running this app. The app will forward you to your clock face immediately after triggering the command.", + "icon": "app.png", + "tags": "android, gadgetbridge, bluetooth, bt", + "supports" : ["BANGLEJS", "BANGLEJS2"], + "storage": [ + {"name":"gbdiscon.app.js","url":"app.js"}, + {"name":"gbdiscon.img","url":"app-icon.js","evaluate":true} + ] +}