Compare commits
3
Commits
41129e49cc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
689990639d | ||
|
|
23312478be | ||
|
|
36a4a9a3e5 |
@@ -1,2 +1,5 @@
|
|||||||
hrm/hrm
|
hrm/hrm
|
||||||
*.apk
|
*.apk
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
*.idsig
|
||||||
|
|||||||
+13
-4
@@ -1,10 +1,19 @@
|
|||||||
module st.wow.git/gmp/hrm/hrm
|
module st.wow.git/gmp/hrm/hrm
|
||||||
|
|
||||||
go 1.14
|
go 1.24.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gioui.org v0.0.0-20200829162755-829ee4559c5a
|
gioui.org v0.10.2
|
||||||
gioui.org/cmd v0.0.0-20200829162755-829ee4559c5a
|
git.wow.st/gmp/ble v0.0.0-20260822003457-e53c7be9766b
|
||||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410
|
|
||||||
gopkg.in/yaml.v2 v2.3.0
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
gioui.org/shader v1.0.9 // indirect
|
||||||
|
github.com/go-text/typesetting v0.3.4 // indirect
|
||||||
|
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
|
||||||
|
golang.org/x/image v0.26.0 // indirect
|
||||||
|
golang.org/x/net v0.48.0 // indirect
|
||||||
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
|
golang.org/x/text v0.32.0 // indirect
|
||||||
|
)
|
||||||
|
|||||||
+26
-81
@@ -1,107 +1,52 @@
|
|||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
gioui.org v0.0.0-20191126175243-2ca2e5462f16 h1:p31rtmKm51xpj2QtqGNlljAyHEP1oStU8MDRl2Dv7Gs=
|
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d h1:ARo7NCVvN2NdhLlJE9xAbKweuI9L6UgfTbYb0YwPacY=
|
||||||
gioui.org v0.0.0-20191126175243-2ca2e5462f16/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d/go.mod h1:OYVuxibdk9OSLX8vAqydtRPP87PyTFcT9uH3MlEGBQA=
|
||||||
gioui.org v0.0.0-20200612151431-2dc19a36959c h1:sGUKyRMv2bbfbsRyG8ghOI12l+WCGta+PivmznjuLgo=
|
|
||||||
gioui.org v0.0.0-20200612151431-2dc19a36959c/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
|
||||||
gioui.org v0.0.0-20200619121558-88ced59dad93/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
|
||||||
gioui.org v0.0.0-20200715100850-e48b85f8d92e/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
|
||||||
gioui.org v0.0.0-20200726090130-3b95e2918359 h1:lae3H0ZryBOt3Kboxa55mpo5KsASVHSdS65EsGMf9kc=
|
|
||||||
gioui.org v0.0.0-20200726090130-3b95e2918359/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
|
||||||
gioui.org v0.0.0-20200829162755-829ee4559c5a h1:mciXRGzQwU0TbgCILZzl6L1nYIWU31lDGIb+8RYige8=
|
|
||||||
gioui.org v0.0.0-20200829162755-829ee4559c5a/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
|
gioui.org v0.0.0-20200829162755-829ee4559c5a/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
|
||||||
gioui.org/cmd v0.0.0-20200726090130-3b95e2918359 h1:oIoK6LiOPvctO41lzgsQckWuN+nKO5WktPNUplEZf68=
|
gioui.org v0.10.2 h1:bZU5CORROwc51sNha0zYdE2qWVaDncOp5EjV5nrZQZ8=
|
||||||
gioui.org/cmd v0.0.0-20200726090130-3b95e2918359/go.mod h1:HNGpTdPoljZA5nsjt6wLgnB6gyU6WL6531yQdsD7cE4=
|
gioui.org v0.10.2/go.mod h1:iKILKNq6+LHMWhP/HjGDW/wDidUzRnb7B6c7ZD9y1Mg=
|
||||||
gioui.org/cmd v0.0.0-20200829162755-829ee4559c5a h1:TXnkA3Fdk7FpwZ6x9lbIAZoTKOg/i5aTLIJ4f7SSagY=
|
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
|
||||||
gioui.org/cmd v0.0.0-20200829162755-829ee4559c5a/go.mod h1:dlmJnCEkOpRaChYxRmJZ5S4jk6y7DCfWnec39xGbUYk=
|
gioui.org/shader v1.0.9 h1:XxnqIfmClWpN49kizxH2W0JcCFrrEP4q3jZmNYaltbs=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191127164604-2af636b9461a h1:Nr6kwAliHs2EsGv4Q1EgQACfbb/hVnTYq0CkWfqIj+g=
|
gioui.org/shader v1.0.9/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191127164604-2af636b9461a/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
git.wow.st/gmp/ble v0.0.0-20260822003457-e53c7be9766b h1:AUvcBwxTD+OlayRckL57H1GTtY0/qOiGJEUlkAFS9z8=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191204220614-4cdaceda7601 h1:lgoKiQ1MzXfh4+sl601d0RR6/Kt182MiegqLtdVBy1I=
|
git.wow.st/gmp/ble v0.0.0-20260822003457-e53c7be9766b/go.mod h1:NrH2R84qUcPGoI9MmPGB1GFIbQxCWEw4WpVnDEn/WUc=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191204220614-4cdaceda7601/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191204222510-e7f82ac9e7f9/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191205134941-3bc712870db2 h1:yYtHMSaVp/dqxuv/GA63C7xIGbN9mrSICEZB3NHdrzc=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191205134941-3bc712870db2/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191206192216-c6f6e4f3174d h1:ur7fwGJ/P92xYTAvczK5VrtnFXDAlStlnK+kAAy4mjc=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191206192216-c6f6e4f3174d/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191206212213-ca70d55f7ed5 h1:Zo9nEEbm7eHW9vA5jWkI10lJC2rpSoNjsc1W1MA2woA=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191206212213-ca70d55f7ed5/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191210141332-1601787ecfa0 h1:EGEsiQf4Ke36NxTkdr6dTBPdCVd032NMCK1I/n4hWwY=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191210141332-1601787ecfa0/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191211145827-dd7d927044f3 h1:EI7VhFijk85f3kcJ301QaHvxoDhQChAzfzlByrnpW0g=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191211145827-dd7d927044f3/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191213173536-99bfee1cbdbf h1:LBqP/fMUR0FZN7YwiwuZ6i5XhgDzpOqMhUhZTA4+s/A=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191213173536-99bfee1cbdbf/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191213182030-52217c3f6a2f h1:rLZaIsaH0Ai7W6sWunN16dQ9rRTuvRcegZS/nkNbPpU=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191213182030-52217c3f6a2f/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191230162624-2d7594514cb3 h1:rMmx9qz3lb6kdzKzU2cJgb9opi+W/YQwtAbbjSCmVGg=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20191230162624-2d7594514cb3/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200204223639-7a583419c528 h1:jXHDwWWs11Qua2DSdgU1WBW2HNDPQU9/IjoZ4d5oAsI=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200204223639-7a583419c528/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200612201046-f5cc27a30de7 h1:RoWGPgYpz5szRySgT6/Vykxw0nBMH39Mv2+ghsMy82I=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200612201046-f5cc27a30de7/go.mod h1:CpPW2hELyNbPdD2I6XvJsu3PQ23iPYtlLTydJ+KZMbQ=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200619183549-b0b310a7b0d2 h1:X/NZSZaKiBOfLR3V+8+erNYJrwLfTD+dukqhCpjWgzo=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200619183549-b0b310a7b0d2/go.mod h1:ObxuF1L41fWoIEfwX2Rww1veGj77dXVISXJA6sqThBA=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410 h1:oR4E/sHCCJ6GnZGWJb2pIwuSKAO/P1QfB3sXHUQHWXU=
|
|
||||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410/go.mod h1:NrH2R84qUcPGoI9MmPGB1GFIbQxCWEw4WpVnDEn/WUc=
|
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g=
|
|
||||||
github.com/chromedp/chromedp v0.5.2/go.mod h1:rsTo/xRo23KZZwFmWk2Ui79rBaVRRATCjLzNQlOFSiA=
|
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
github.com/go-text/typesetting v0.3.4 h1:YYurUOtEb9kGSOz4uE3k4OpBGsp1dDL8+fjCeaFamAU=
|
||||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
github.com/go-text/typesetting v0.3.4/go.mod h1:4qZCQphq4KSgGTAeI0uMEkVbROgfah8BuyF5LRYr7XY=
|
||||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3 h1:drBZzMgdYPbmyXqOto4YhhJGrFIQCX94FpR4MzTCsos=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/go-text/typesetting-utils v0.0.0-20260223113751-2d88ac90dae3/go.mod h1:3/62I4La/HBRX9TcTpBj4eipLiwzf+vhI+7whTc9V7o=
|
||||||
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
|
|
||||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
|
||||||
github.com/google/go-github/v24 v24.0.1 h1:KCt1LjMJEey1qvPXxa9SjaWxwTsCWSq6p2Ju57UR4Q4=
|
|
||||||
github.com/google/go-github/v24 v24.0.1/go.mod h1:CRqaW1Uns1TCkP0wqTpxYyRxRjxwvKU/XSS44u6X74M=
|
|
||||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
|
||||||
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0=
|
|
||||||
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
|
|
||||||
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3 h1:n9HxLrNxWWtEb1cA950nuEEj3QnKbtsCJ6KjcgisNUs=
|
|
||||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
|
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
|
||||||
|
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
|
||||||
|
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
|
||||||
|
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0 h1:tMSqXTK+AQdW3LpCbfatHSRPHeW6+2WuxaVQuHftn80=
|
||||||
|
golang.org/x/exp/shiny v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:ygj7T6vSGhhm/9yTpOQQNvuAUFziTH7RUiH74EoE2C8=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
|
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.0.0-20200618115811-c13761719519 h1:1e2ufUJNM3lCHEY5jIgac/7UTjd6cgJNdatjPdFWf34=
|
|
||||||
golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY=
|
||||||
|
golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c=
|
||||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
|
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
||||||
golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c h1:HjRaKPaiWks0f5tA6ELVF7ZfqSppfPwOEEAvsrKUTO4=
|
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
||||||
golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
|
|
||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
|
|
||||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||||
|
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e h1:1xWUkZQQ9Z9UuZgNaIR6OQOE7rUFglXUUBZlO+dGg6I=
|
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||||
|
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||||
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
|
|
||||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
|||||||
+161
-60
@@ -5,10 +5,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.wow.st/gmp/ble"
|
"git.wow.st/gmp/ble"
|
||||||
@@ -16,9 +17,8 @@ import (
|
|||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"gioui.org/app"
|
"gioui.org/app"
|
||||||
"gioui.org/io/system"
|
|
||||||
"gioui.org/layout"
|
|
||||||
"gioui.org/f32"
|
"gioui.org/f32"
|
||||||
|
"gioui.org/layout"
|
||||||
"gioui.org/op"
|
"gioui.org/op"
|
||||||
"gioui.org/op/clip"
|
"gioui.org/op/clip"
|
||||||
"gioui.org/op/paint"
|
"gioui.org/op/paint"
|
||||||
@@ -42,6 +42,16 @@ type conf struct {
|
|||||||
var Config conf
|
var Config conf
|
||||||
var conffile string
|
var conffile string
|
||||||
|
|
||||||
|
var (
|
||||||
|
// bleMu guards bleView, scanPending and the UI state read by the
|
||||||
|
// frame handler and written by the Bluetooth event goroutine.
|
||||||
|
bleMu sync.Mutex
|
||||||
|
bleView uintptr
|
||||||
|
scanPending bool
|
||||||
|
rendered bool
|
||||||
|
stopwatchRunning bool // live stopwatch on screen; needs continuous redraw
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
conffile = path.Join(getConfDir(), "config.yml")
|
conffile = path.Join(getConfDir(), "config.yml")
|
||||||
if _, err := os.Stat(conffile); os.IsNotExist(err) {
|
if _, err := os.Stat(conffile); os.IsNotExist(err) {
|
||||||
@@ -52,7 +62,7 @@ func main() {
|
|||||||
fd.Close()
|
fd.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
confbytes, err := ioutil.ReadFile(conffile)
|
confbytes, err := os.ReadFile(conffile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Cannot read configuration file: ", err)
|
log.Fatal("Cannot read configuration file: ", err)
|
||||||
}
|
}
|
||||||
@@ -68,7 +78,7 @@ func saveConfig() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Cannot encode configuration: ", err)
|
log.Fatal("Cannot encode configuration: ", err)
|
||||||
}
|
}
|
||||||
err = ioutil.WriteFile(conffile, confbytes, 0700)
|
err = os.WriteFile(conffile, confbytes, 0700)
|
||||||
}
|
}
|
||||||
|
|
||||||
func hrDecode(x []byte) int {
|
func hrDecode(x []byte) int {
|
||||||
@@ -84,32 +94,58 @@ func hrDecode(x []byte) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Stopwatch struct {
|
type Stopwatch struct {
|
||||||
lasttime time.Time
|
lasttime time.Time
|
||||||
elapsed time.Time
|
elapsed time.Time
|
||||||
running bool
|
running bool
|
||||||
startstopBtn *widget.Clickable
|
startstopBtn *widget.Clickable
|
||||||
resetBtn *widget.Clickable
|
resetBtn *widget.Clickable
|
||||||
h, m, s int
|
h, m, s int
|
||||||
|
}
|
||||||
|
|
||||||
|
// circleClip returns a clip operation for a circle of the given radius
|
||||||
|
// centered at center, approximated by four cubic Bézier curves.
|
||||||
|
//
|
||||||
|
// clip.Path.Cube takes control points relative to the current pen
|
||||||
|
// position. Starting at the right point and going clockwise, the
|
||||||
|
// control points for the first segment are (0,k), (k-r, r) and the end
|
||||||
|
// point is (-r, r); the other three segments follow by symmetry. The
|
||||||
|
// second control point of each segment sits k before the end point
|
||||||
|
// along the tangent, i.e. at (k-r) — not (k) — from the start along
|
||||||
|
// the tangential axis. With (k) the shape bulges out past the circle
|
||||||
|
// near the diagonal corners.
|
||||||
|
func circleClip(ops *op.Ops, center f32.Point, radius float32) clip.Op {
|
||||||
|
p := &clip.Path{}
|
||||||
|
p.Begin(ops)
|
||||||
|
k := radius * 0.5522847498
|
||||||
|
p.MoveTo(center.Add(f32.Point{X: radius}))
|
||||||
|
p.Cube(f32.Point{Y: k}, f32.Point{X: k - radius, Y: radius}, f32.Point{X: -radius, Y: radius})
|
||||||
|
p.Cube(f32.Point{X: -k}, f32.Point{X: -radius, Y: k - radius}, f32.Point{X: -radius, Y: -radius})
|
||||||
|
p.Cube(f32.Point{Y: -k}, f32.Point{X: radius - k, Y: -radius}, f32.Point{X: radius, Y: -radius})
|
||||||
|
p.Cube(f32.Point{X: k}, f32.Point{X: radius, Y: radius - k}, f32.Point{X: radius, Y: radius})
|
||||||
|
p.Close()
|
||||||
|
return clip.Outline{Path: p.End()}.Op()
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStopwatch() Stopwatch {
|
func NewStopwatch() Stopwatch {
|
||||||
return Stopwatch{
|
return Stopwatch{
|
||||||
startstopBtn: &widget.Clickable{},
|
startstopBtn: &widget.Clickable{},
|
||||||
resetBtn: &widget.Clickable{},
|
resetBtn: &widget.Clickable{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func eventloop() {
|
func eventloop() {
|
||||||
w := app.NewWindow(
|
w := new(app.Window)
|
||||||
|
w.Option(
|
||||||
app.Size(unit.Dp(350), unit.Dp(600)),
|
app.Size(unit.Dp(350), unit.Dp(600)),
|
||||||
app.Title("HRM"),
|
app.Title("HRM"),
|
||||||
)
|
)
|
||||||
th := material.NewTheme(gofont.Collection())
|
th := material.NewTheme()
|
||||||
|
th.Face = gofont.Collection()[0].Font.Typeface
|
||||||
th.TextSize = unit.Sp(fontSize)
|
th.TextSize = unit.Sp(fontSize)
|
||||||
var ops op.Ops
|
var ops op.Ops
|
||||||
|
|
||||||
sysinset := &layout.Inset{}
|
sysinset := &layout.Inset{}
|
||||||
resetSysinset := func(x system.Insets) {
|
resetSysinset := func(x app.Insets) {
|
||||||
sysinset.Top = x.Top
|
sysinset.Top = x.Top
|
||||||
sysinset.Bottom = x.Bottom
|
sysinset.Bottom = x.Bottom
|
||||||
sysinset.Left = x.Left
|
sysinset.Left = x.Left
|
||||||
@@ -119,6 +155,13 @@ func eventloop() {
|
|||||||
|
|
||||||
b := ble.NewBLE()
|
b := ble.NewBLE()
|
||||||
|
|
||||||
|
// requestScan defers a scan to the worker goroutine, which checks the
|
||||||
|
// runtime permission (JNI on a dedicated attached thread) and starts
|
||||||
|
// the scan. Callers must hold bleMu.
|
||||||
|
requestScan := func() {
|
||||||
|
scanPending = true
|
||||||
|
}
|
||||||
|
|
||||||
state := "starting"
|
state := "starting"
|
||||||
var hr int
|
var hr int
|
||||||
var periph ble.Peripheral
|
var periph ble.Peripheral
|
||||||
@@ -172,10 +215,14 @@ func eventloop() {
|
|||||||
lst := &layout.List{Axis: layout.Vertical}
|
lst := &layout.List{Axis: layout.Vertical}
|
||||||
return lst.Layout(gtx, len(periphs), func(gtx C, i int) D {
|
return lst.Layout(gtx, len(periphs), func(gtx C, i int) D {
|
||||||
gtx.Constraints.Min.X = gtx.Constraints.Max.X
|
gtx.Constraints.Min.X = gtx.Constraints.Max.X
|
||||||
|
// Clicked must be called before Layout: in Gio v0.10 the
|
||||||
|
// Clickable consumes its click events during Layout, and a
|
||||||
|
// later Clicked call would never see them.
|
||||||
|
clicked := btns[i].Clicked(gtx)
|
||||||
ret := layout.UniformInset(unit.Dp(2)).Layout(gtx, func(gtx C) D {
|
ret := layout.UniformInset(unit.Dp(2)).Layout(gtx, func(gtx C) D {
|
||||||
return material.Button(th, btns[i], periphs[i].Name).Layout(gtx)
|
return material.Button(th, btns[i], periphs[i].Name).Layout(gtx)
|
||||||
})
|
})
|
||||||
if btns[i].Clicked() {
|
if clicked {
|
||||||
b.StopScan()
|
b.StopScan()
|
||||||
periph = periphs[i]
|
periph = periphs[i]
|
||||||
b.Connect(periph)
|
b.Connect(periph)
|
||||||
@@ -209,15 +256,17 @@ func eventloop() {
|
|||||||
layout.Rigid(appstate),
|
layout.Rigid(appstate),
|
||||||
layout.Rigid(periphname),
|
layout.Rigid(periphname),
|
||||||
layout.Rigid(func(gtx C) D {
|
layout.Rigid(func(gtx C) D {
|
||||||
|
clicked := backBtn.Clicked(gtx)
|
||||||
ret := material.Button(th, backBtn, "Cancel").Layout(gtx)
|
ret := material.Button(th, backBtn, "Cancel").Layout(gtx)
|
||||||
if backBtn.Clicked() {
|
if clicked {
|
||||||
ble.CancelConnection(periph)
|
ble.CancelConnection(periph)
|
||||||
periphs = periphs[:0]
|
periphs = periphs[:0]
|
||||||
Config.Autoconnect = ""
|
Config.Autoconnect = ""
|
||||||
saveConfig()
|
saveConfig()
|
||||||
b.Scan()
|
requestScan()
|
||||||
state = "scanning"
|
state = "scanning"
|
||||||
page = scanpage
|
page = scanpage
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}),
|
}),
|
||||||
@@ -227,24 +276,18 @@ func eventloop() {
|
|||||||
hrcircle := func(gtx C) (int, D) {
|
hrcircle := func(gtx C) (int, D) {
|
||||||
var w, h1 float32
|
var w, h1 float32
|
||||||
ret := layout.Center.Layout(gtx, func(gtx C) D {
|
ret := layout.Center.Layout(gtx, func(gtx C) D {
|
||||||
blue := color.RGBA{0x3f, 0x51, 0xb5, 255}
|
blue := color.NRGBA{0x3f, 0x51, 0xb5, 255}
|
||||||
white := color.RGBA{255, 255, 255, 255}
|
white := color.NRGBA{255, 255, 255, 255}
|
||||||
w, h1 = float32(gtx.Constraints.Max.X), float32(gtx.Constraints.Max.Y)
|
w, h1 = float32(gtx.Constraints.Max.X), float32(gtx.Constraints.Max.Y)
|
||||||
if w < h1 {
|
if w < h1 {
|
||||||
h1 = w
|
h1 = w
|
||||||
}
|
}
|
||||||
s2 := h1 * 0.9
|
s2 := h1 * 0.9
|
||||||
r1 := f32.Rectangle{f32.Point{0, 0}, f32.Point{h1, h1}}
|
p2a := f32.Point{(h1 - s2) / 2, (h1 - s2) / 2}
|
||||||
p2a := f32.Point{(h1-s2)/2, (h1-s2)/2}
|
center := f32.Point{X: h1 / 2, Y: h1 / 2}
|
||||||
p2b := f32.Point{s2 + (h1-s2)/2, s2 + (h1-s2)/2}
|
paint.FillShape(gtx.Ops, blue, circleClip(gtx.Ops, center, h1/2))
|
||||||
r2 := f32.Rectangle{p2a, p2b}
|
paint.FillShape(gtx.Ops, white, circleClip(gtx.Ops, center, h1*0.9/2))
|
||||||
clip.RRect{ Rect: r1, NE: h1/2, NW: h1/2, SE: h1/2, SW: h1/2}.Add(gtx.Ops)
|
op.Affine(f32.NewAffine2D(1, 0, p2a.X, 0, 1, p2a.Y)).Add(gtx.Ops)
|
||||||
paint.ColorOp{Color: blue}.Add(gtx.Ops)
|
|
||||||
paint.PaintOp{Rect: r1}.Add(gtx.Ops)
|
|
||||||
clip.RRect{ Rect: r2, NE: s2/2, NW: s2/2, SE: s2/2, SW: s2/2}.Add(gtx.Ops)
|
|
||||||
paint.ColorOp{Color: white}.Add(gtx.Ops)
|
|
||||||
paint.PaintOp{Rect: r2}.Add(gtx.Ops)
|
|
||||||
op.Offset(p2a).Add(gtx.Ops)
|
|
||||||
gtx.Constraints.Max.X = int(s2)
|
gtx.Constraints.Max.X = int(s2)
|
||||||
gtx.Constraints.Max.Y = int(s2)
|
gtx.Constraints.Max.Y = int(s2)
|
||||||
gtx.Constraints.Min.X = int(s2)
|
gtx.Constraints.Min.X = int(s2)
|
||||||
@@ -264,6 +307,8 @@ func eventloop() {
|
|||||||
sw := NewStopwatch()
|
sw := NewStopwatch()
|
||||||
|
|
||||||
stopwatch := func(gtx C) D {
|
stopwatch := func(gtx C) D {
|
||||||
|
// The live stopwatch needs continuous redraws; tell the worker.
|
||||||
|
stopwatchRunning = sw.running
|
||||||
startstoptxt := "start"
|
startstoptxt := "start"
|
||||||
if sw.running {
|
if sw.running {
|
||||||
sw.elapsed = sw.elapsed.Add(time.Since(sw.lasttime))
|
sw.elapsed = sw.elapsed.Add(time.Since(sw.lasttime))
|
||||||
@@ -281,6 +326,8 @@ func eventloop() {
|
|||||||
layout.Rigid(func(gtx C) D {
|
layout.Rigid(func(gtx C) D {
|
||||||
f2 := layout.Flex{Axis: layout.Horizontal}
|
f2 := layout.Flex{Axis: layout.Horizontal}
|
||||||
gtx.Constraints.Min.Y = 100
|
gtx.Constraints.Min.Y = 100
|
||||||
|
startstopClicked := sw.startstopBtn.Clicked(gtx)
|
||||||
|
resetClicked := sw.resetBtn.Clicked(gtx)
|
||||||
ret := f2.Layout(gtx,
|
ret := f2.Layout(gtx,
|
||||||
layout.Flexed(0.5, func(gtx C) D {
|
layout.Flexed(0.5, func(gtx C) D {
|
||||||
return layout.UniformInset(unit.Dp(2)).Layout(gtx, func(gtx C) D {
|
return layout.UniformInset(unit.Dp(2)).Layout(gtx, func(gtx C) D {
|
||||||
@@ -293,16 +340,18 @@ func eventloop() {
|
|||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
if sw.startstopBtn.Clicked() {
|
if startstopClicked {
|
||||||
if sw.running {
|
if sw.running {
|
||||||
sw.running = false
|
sw.running = false
|
||||||
} else {
|
} else {
|
||||||
sw.running = true
|
sw.running = true
|
||||||
}
|
}
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
if sw.resetBtn.Clicked() {
|
if resetClicked {
|
||||||
sw.elapsed = time.Time{}
|
sw.elapsed = time.Time{}
|
||||||
sw.running = false
|
sw.running = false
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}),
|
}),
|
||||||
@@ -311,6 +360,7 @@ func eventloop() {
|
|||||||
|
|
||||||
swidth := new(int)
|
swidth := new(int)
|
||||||
hrpage = func(gtx C) D {
|
hrpage = func(gtx C) D {
|
||||||
|
backBtnClicked := backBtn.Clicked(gtx)
|
||||||
var ret, ret2 D
|
var ret, ret2 D
|
||||||
stopbtn := func(gtx C) D {
|
stopbtn := func(gtx C) D {
|
||||||
gtx.Constraints.Min.Y = 100
|
gtx.Constraints.Min.Y = 100
|
||||||
@@ -403,26 +453,68 @@ func eventloop() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if backBtn.Clicked() {
|
if backBtnClicked {
|
||||||
ble.Disconnect(periph)
|
ble.Disconnect(periph)
|
||||||
periphs = periphs[:0]
|
periphs = periphs[:0]
|
||||||
Config.Autoconnect = ""
|
Config.Autoconnect = ""
|
||||||
saveConfig()
|
saveConfig()
|
||||||
b.Scan()
|
requestScan()
|
||||||
state = "scanning"
|
state = "scanning"
|
||||||
page = scanpage
|
page = scanpage
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
page = offpage
|
page = offpage
|
||||||
|
|
||||||
t := time.NewTicker(time.Second/30)
|
// Worker: start any scan that was deferred waiting for the runtime
|
||||||
for {
|
// permission grant, and drive the live stopwatch animation.
|
||||||
select {
|
//
|
||||||
case <-t.C:
|
// There is no fixed redraw rate: everything else is event-driven
|
||||||
w.Invalidate()
|
// (Bluetooth events and clicks call w.Invalidate). The permission
|
||||||
case e := <-b.Events():
|
// check is a binder call, so it is only made while a scan is
|
||||||
|
// actually pending, and at most a few times per second.
|
||||||
|
//
|
||||||
|
// This goroutine is pinned to its OS thread and attached to the JVM
|
||||||
|
// exactly once for the life of the app (see jvmReady): repeated
|
||||||
|
// attach/detach of a Go thread eventually stack-overflows the
|
||||||
|
// Java side. Running b.Scan from the same thread also keeps ble's
|
||||||
|
// runInJVM from attaching/detaching on its own.
|
||||||
|
go func() {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
t := time.NewTicker(time.Second / 30)
|
||||||
|
tick := 0
|
||||||
|
for range t.C {
|
||||||
|
tick++
|
||||||
|
if !jvmReady() {
|
||||||
|
// JVM not up yet; retry next tick.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
bleMu.Lock()
|
||||||
|
if scanPending && rendered && tick%10 == 0 && scanPermGranted(bleView) {
|
||||||
|
scanPending = false
|
||||||
|
b.Scan()
|
||||||
|
}
|
||||||
|
// Redraw at 30 FPS until the first frame has actually been
|
||||||
|
// produced: invalidations before the surface is ready are lost,
|
||||||
|
// and nothing else may arrive if no Bluetooth events flow.
|
||||||
|
invalidate := stopwatchRunning || !rendered
|
||||||
|
bleMu.Unlock()
|
||||||
|
if invalidate {
|
||||||
|
w.Invalidate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Handle Bluetooth events off the render loop and mark the window
|
||||||
|
// dirty so a new frame is produced. Gio requires the window's event
|
||||||
|
// loop and Frame calls to happen in a single goroutine, so state
|
||||||
|
// shared with the frame handler is guarded by bleMu.
|
||||||
|
go func() {
|
||||||
|
for e := range b.Events() {
|
||||||
|
log.Print("<-b.Events")
|
||||||
|
bleMu.Lock()
|
||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
case ble.UpdateStateEvent:
|
case ble.UpdateStateEvent:
|
||||||
fmt.Printf("UpdateState: %s\n", e.State)
|
fmt.Printf("UpdateState: %s\n", e.State)
|
||||||
@@ -439,7 +531,7 @@ func eventloop() {
|
|||||||
periphs = periphs[:0]
|
periphs = periphs[:0]
|
||||||
state = "scanning"
|
state = "scanning"
|
||||||
page = scanpage
|
page = scanpage
|
||||||
b.Scan()
|
requestScan()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case ble.DiscoverPeripheralEvent:
|
case ble.DiscoverPeripheralEvent:
|
||||||
@@ -466,7 +558,7 @@ func eventloop() {
|
|||||||
page = scanpage
|
page = scanpage
|
||||||
Config.Autoconnect = ""
|
Config.Autoconnect = ""
|
||||||
saveConfig()
|
saveConfig()
|
||||||
b.Scan()
|
requestScan()
|
||||||
case ble.DiscoverServiceEvent:
|
case ble.DiscoverServiceEvent:
|
||||||
fmt.Printf("DiscoverService %s\n", e.Gatt.UUID)
|
fmt.Printf("DiscoverService %s\n", e.Gatt.UUID)
|
||||||
//if e.Gatt.UUID == "180D" {
|
//if e.Gatt.UUID == "180D" {
|
||||||
@@ -484,26 +576,35 @@ func eventloop() {
|
|||||||
case ble.UpdateValueEvent:
|
case ble.UpdateValueEvent:
|
||||||
hr = hrDecode(e.Data)
|
hr = hrDecode(e.Data)
|
||||||
}
|
}
|
||||||
|
bleMu.Unlock()
|
||||||
w.Invalidate() // refresh on any Bluetooth event
|
w.Invalidate() // refresh on any Bluetooth event
|
||||||
case e := <-w.Events():
|
}
|
||||||
switch e := e.(type) {
|
}()
|
||||||
case system.DestroyEvent:
|
|
||||||
os.Exit(0)
|
// The render loop. Gio requires Event and Frame to be driven from
|
||||||
case system.FrameEvent:
|
// one goroutine.
|
||||||
gtx := layout.NewContext(&ops, e)
|
for {
|
||||||
if e.Size.X > e.Size.Y {
|
switch e := w.Event().(type) {
|
||||||
wide = true
|
case app.DestroyEvent:
|
||||||
} else {
|
os.Exit(0)
|
||||||
wide = false
|
case app.FrameEvent:
|
||||||
}
|
bleMu.Lock()
|
||||||
resetSysinset(e.Insets)
|
rendered = true
|
||||||
sysinset.Layout(gtx, func(gtx C) D {
|
stopwatchRunning = false // set by the stopwatch layout if drawn
|
||||||
return margin.Layout(gtx, page)
|
gtx := app.NewContext(&ops, e)
|
||||||
})
|
if e.Size.X > e.Size.Y {
|
||||||
e.Frame(gtx.Ops)
|
wide = true
|
||||||
default:
|
} else {
|
||||||
handleEvent(e, b)
|
wide = false
|
||||||
}
|
}
|
||||||
|
resetSysinset(e.Insets)
|
||||||
|
sysinset.Layout(gtx, func(gtx C) D {
|
||||||
|
return margin.Layout(gtx, page)
|
||||||
|
})
|
||||||
|
bleMu.Unlock()
|
||||||
|
e.Frame(gtx.Ops)
|
||||||
|
default:
|
||||||
|
handleEvent(e, b, w)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-4
@@ -15,7 +15,7 @@ var fontSize float32 = 24
|
|||||||
func getConfDir() string {
|
func getConfDir() string {
|
||||||
if confDir == "" {
|
if confDir == "" {
|
||||||
var err error
|
var err error
|
||||||
confDir,err = app.DataDir()
|
confDir, err = app.DataDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Cannot get configuration directory")
|
log.Fatal("Cannot get configuration directory")
|
||||||
}
|
}
|
||||||
@@ -23,9 +23,19 @@ func getConfDir() string {
|
|||||||
return confDir
|
return confDir
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleEvent(e event.Event, b *ble.BLE) {
|
func handleEvent(e event.Event, b *ble.BLE, w *app.Window) {
|
||||||
switch e:= e.(type) {
|
switch e := e.(type) {
|
||||||
case app.ViewEvent:
|
case app.AndroidViewEvent:
|
||||||
b.Enable(e.View)
|
b.Enable(e.View)
|
||||||
|
bleMu.Lock()
|
||||||
|
bleView = e.View
|
||||||
|
bleMu.Unlock()
|
||||||
|
// The runtime permission is requested by BlessedConnect.onAttach;
|
||||||
|
// the worker goroutine starts the pending scan once the grant is
|
||||||
|
// observed. Invalidate for the first frame: nothing else redraws
|
||||||
|
// until a Bluetooth or input event arrives.
|
||||||
|
if e.Valid() {
|
||||||
|
w.Invalidate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -1,4 +1,4 @@
|
|||||||
//+build !android
|
//go:build !android
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -7,5 +7,9 @@ import (
|
|||||||
"git.wow.st/gmp/ble"
|
"git.wow.st/gmp/ble"
|
||||||
)
|
)
|
||||||
|
|
||||||
func handleEvent(e event.Event, b *ble.BLE) {
|
func handleEvent(e event.Event, b *ble.BLE, w *app.Window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Non-Android platforms have no runtime BLE permission gate.
|
||||||
|
func jvmReady() bool { return true }
|
||||||
|
func scanPermGranted(view uintptr) bool { return true }
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
//go:build android
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <jni.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
|
// JNIEnv/JavaVM accessors (the JNI macros are not visible to cgo).
|
||||||
|
static jint hrm_getenv(JavaVM *vm, JNIEnv **env) {
|
||||||
|
return (*vm)->GetEnv(vm, (void **)env, JNI_VERSION_1_6);
|
||||||
|
}
|
||||||
|
|
||||||
|
static jint hrm_attach(JavaVM *vm, JNIEnv **env) {
|
||||||
|
return (*vm)->AttachCurrentThread(vm, (void **)env, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static jobject hrm_context(JNIEnv *env, jobject view) {
|
||||||
|
jclass cls = (*env)->GetObjectClass(env, view);
|
||||||
|
jmethodID m = (*env)->GetMethodID(env, cls, "getContext", "()Landroid/content/Context;");
|
||||||
|
return (*env)->CallObjectMethod(env, view, m);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int hrm_sdk(JNIEnv *env) {
|
||||||
|
jclass b = (*env)->FindClass(env, "android/os/Build$VERSION");
|
||||||
|
jfieldID f = (*env)->GetStaticFieldID(env, b, "SDK_INT", "I");
|
||||||
|
return (*env)->GetStaticIntField(env, b, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns 1 if the given permission is granted to ctx, 0 otherwise.
|
||||||
|
// checkSelfPermission requires API 23; on older devices permissions were
|
||||||
|
// granted at install time, so report granted.
|
||||||
|
static int hrm_perm_granted(JNIEnv *env, jobject ctx, const char *perm) {
|
||||||
|
jclass cls = (*env)->GetObjectClass(env, ctx);
|
||||||
|
jmethodID m = (*env)->GetMethodID(env, cls, "checkSelfPermission", "(Ljava/lang/String;)I");
|
||||||
|
if (m == 0) {
|
||||||
|
(*env)->ExceptionClear(env);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
jstring s = (*env)->NewStringUTF(env, perm);
|
||||||
|
int r = (*env)->CallIntMethod(env, ctx, m, s);
|
||||||
|
(*env)->DeleteLocalRef(env, s);
|
||||||
|
if ((*env)->ExceptionOccurred(env)) {
|
||||||
|
(*env)->ExceptionClear(env);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return r == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns 1 if the permission required to scan is currently granted.
|
||||||
|
// The request itself is made by BlessedConnect.onAttach (see the ble
|
||||||
|
// package); this only observes the result.
|
||||||
|
static int hrm_scan_perm_granted(JNIEnv *env, jobject view) {
|
||||||
|
jobject ctx = hrm_context(env, view);
|
||||||
|
if (ctx == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int sdk = hrm_sdk(env);
|
||||||
|
const char *perm;
|
||||||
|
if (sdk >= 31) {
|
||||||
|
perm = "android.permission.BLUETOOTH_SCAN";
|
||||||
|
} else {
|
||||||
|
perm = "android.permission.ACCESS_FINE_LOCATION";
|
||||||
|
}
|
||||||
|
int r = hrm_perm_granted(env, ctx, perm);
|
||||||
|
(*env)->DeleteLocalRef(env, ctx);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
|
"gioui.org/app"
|
||||||
|
)
|
||||||
|
|
||||||
|
// workerEnv is the JNIEnv of the pinned worker OS thread. It is written
|
||||||
|
// exactly once (on that thread) and read only there.
|
||||||
|
var workerEnv *C.JNIEnv
|
||||||
|
|
||||||
|
// jvmReady attaches the current OS thread to the JVM, once, and reports
|
||||||
|
// whether a JNIEnv is available.
|
||||||
|
//
|
||||||
|
// The worker must call this from a pinned goroutine (runtime.LockOSThread)
|
||||||
|
// and must NEVER detach: ART allocates the Java-side stack at first attach
|
||||||
|
// based on the thread's stack pointer at that moment. Repeatedly
|
||||||
|
// attaching/detaching a Go OS thread (whose stack is managed by the Go
|
||||||
|
// runtime) eventually leaves the Java stack exhausted and the next JNI
|
||||||
|
// call dies with "No pending exception expected:
|
||||||
|
// java.lang.StackOverflowError".
|
||||||
|
//
|
||||||
|
// As a side effect, calling ble.BLE methods from this same thread makes
|
||||||
|
// ble's own runInJVM skip its attach/detach (GetEnv already succeeds).
|
||||||
|
func jvmReady() bool {
|
||||||
|
if workerEnv != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if app.JavaVM() == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
vm := (*C.JavaVM)(unsafe.Pointer(app.JavaVM()))
|
||||||
|
var env *C.JNIEnv
|
||||||
|
if C.hrm_getenv(vm, &env) == 0 {
|
||||||
|
// Already attached (e.g. this is the UI thread).
|
||||||
|
workerEnv = env
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if C.hrm_attach(vm, &env) != 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
workerEnv = env
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// scanPermGranted reports whether the runtime permission needed for
|
||||||
|
// Bluetooth scanning is currently granted. Call from the worker.
|
||||||
|
func scanPermGranted(view uintptr) bool {
|
||||||
|
if view == 0 || !jvmReady() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return C.hrm_scan_perm_granted(workerEnv, C.jobject(view)) == 1
|
||||||
|
}
|
||||||
Executable
+110
@@ -0,0 +1,110 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build (and optionally install) the HRM Android APK.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./scripts/build.sh [phone|emu] # build + install (default: phone)
|
||||||
|
# ./scripts/build.sh phone --no-install # build only
|
||||||
|
#
|
||||||
|
# Output: hrm/hrm.apk
|
||||||
|
#
|
||||||
|
# Prereqs on this workstation (the script checks each and explains what is
|
||||||
|
# missing):
|
||||||
|
# - JDK (java on PATH)
|
||||||
|
# - Go + gogio v0.10.0 (~/go/bin)
|
||||||
|
# - Android SDK at ~/android-sdk (platform-tools, build-tools 35.0.0,
|
||||||
|
# NDK for gogio)
|
||||||
|
# - debug keystore at ~/.android/debug.keystore
|
||||||
|
# apktool is not a prerequisite: if it is missing, the script downloads
|
||||||
|
# v3.0.3 to the stable location ~/android-sdk/tools/apktool.jar.
|
||||||
|
#
|
||||||
|
# Why the apktool detour: gogio's manifest permissions come from a hardcoded
|
||||||
|
# table and only declare the pre-Android-12 BLUETOOTH/BLUETOOTH_ADMIN
|
||||||
|
# permissions. With targetSdk 31+ those are no-ops and BLE needs the
|
||||||
|
# runtime permissions BLUETOOTH_SCAN and BLUETOOTH_CONNECT declared in the
|
||||||
|
# manifest. So we decode the gogio APK, inject the two permissions into
|
||||||
|
# AndroidManifest.xml, rebuild, and re-sign with the debug key. (The
|
||||||
|
# runtime request and scan gating are implemented in Go: see
|
||||||
|
# hrm/perm_android.go.)
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REPO=$(cd "$(dirname "$0")/.." && pwd)
|
||||||
|
export ANDROID_HOME=${ANDROID_HOME:-$HOME/android-sdk}
|
||||||
|
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/35.0.0:$HOME/go/bin
|
||||||
|
|
||||||
|
MODE=${1:-phone}
|
||||||
|
INSTALL=1
|
||||||
|
[ "${2:-}" = "--no-install" ] && INSTALL=0
|
||||||
|
case "$MODE" in
|
||||||
|
phone) ARCH="arm64,arm";;
|
||||||
|
emu) ARCH="amd64";;
|
||||||
|
*) echo "usage: $0 [phone|emu] [--no-install]" >&2; exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
die() { echo "ERROR: $*" >&2; exit 1; }
|
||||||
|
|
||||||
|
command -v java >/dev/null 2>&1 || die "java not found"
|
||||||
|
command -v gogio >/dev/null 2>&1 || die "gogio not found (need v0.10.0 in ~/go/bin)"
|
||||||
|
command -v apksigner >/dev/null 2>&1 || die "apksigner not found (need $ANDROID_HOME/build-tools/35.0.0)"
|
||||||
|
command -v adb >/dev/null 2>&1 || die "adb not found (need $ANDROID_HOME/platform-tools)"
|
||||||
|
[ -f "$HOME/.android/debug.keystore" ] || die "debug keystore missing: $HOME/.android/debug.keystore"
|
||||||
|
|
||||||
|
# apktool: auto-download to a stable location if missing.
|
||||||
|
APKTOOL="$ANDROID_HOME/tools/apktool.jar"
|
||||||
|
if [ ! -f "$APKTOOL" ]; then
|
||||||
|
echo "=== apktool missing; downloading v3.0.3 to $APKTOOL ==="
|
||||||
|
mkdir -p "$ANDROID_HOME/tools"
|
||||||
|
curl -fsSL -o "$APKTOOL" \
|
||||||
|
https://github.com/iBotPeaches/Apktool/releases/download/v3.0.3/apktool_3.0.3.jar \
|
||||||
|
|| die "apktool download failed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
WORK=$(mktemp -d)
|
||||||
|
trap 'rm -rf "$WORK"' EXIT
|
||||||
|
|
||||||
|
echo "=== gogio (Go -> APK) ==="
|
||||||
|
# targetSdk 34: targeting 35 makes Android 15 force edge-to-edge, which the
|
||||||
|
# app does not handle.
|
||||||
|
(cd "$REPO/hrm" && gogio -target android -targetsdk 34 -arch "$ARCH" -o "$WORK/hrm-raw.apk" .)
|
||||||
|
[ -f "$WORK/hrm-raw.apk" ] || die "gogio did not produce an APK"
|
||||||
|
|
||||||
|
echo "=== apktool decode + inject BLE permissions ==="
|
||||||
|
# gogio's manifest permissions come from a hardcoded table and only declare
|
||||||
|
# the pre-Android-12 permissions; the runtime permission logic itself lives
|
||||||
|
# in the Go code (hrm/perm_android.go).
|
||||||
|
java -jar "$APKTOOL" d "$WORK/hrm-raw.apk" -o "$WORK/decoded" -f >/dev/null
|
||||||
|
python3 - "$WORK/decoded/AndroidManifest.xml" << 'PYEOF'
|
||||||
|
import sys, pathlib
|
||||||
|
p = pathlib.Path(sys.argv[1])
|
||||||
|
t = p.read_text()
|
||||||
|
perms = [
|
||||||
|
'<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>',
|
||||||
|
'<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>',
|
||||||
|
]
|
||||||
|
for perm in perms:
|
||||||
|
if perm not in t:
|
||||||
|
t = t.replace(" <application", " " + perm + "\n <application", 1)
|
||||||
|
if perm not in t:
|
||||||
|
sys.exit("ERROR: failed to inject " + perm)
|
||||||
|
p.write_text(t)
|
||||||
|
print("manifest: BLUETOOTH_SCAN + BLUETOOTH_CONNECT present")
|
||||||
|
PYEOF
|
||||||
|
|
||||||
|
echo "=== apktool rebuild ==="
|
||||||
|
java -jar "$APKTOOL" b "$WORK/decoded" -o "$WORK/hrm-unsigned.apk" >/dev/null
|
||||||
|
|
||||||
|
echo "=== sign ==="
|
||||||
|
apksigner sign \
|
||||||
|
--ks "$HOME/.android/debug.keystore" --ks-pass pass:android \
|
||||||
|
--key-pass pass:android --ks-key-alias androiddebugkey \
|
||||||
|
--out "$REPO/hrm/hrm.apk" "$WORK/hrm-unsigned.apk"
|
||||||
|
|
||||||
|
# ADB_SERIAL selects the device when several are attached (adb devices).
|
||||||
|
ADB="adb${ADB_SERIAL:+ -s $ADB_SERIAL}"
|
||||||
|
|
||||||
|
if [ "$INSTALL" = "1" ]; then
|
||||||
|
echo "=== install ==="
|
||||||
|
$ADB get-state >/dev/null 2>&1 || die "no adb device (start the emulator or plug in a phone; set ADB_SERIAL if several are attached)"
|
||||||
|
$ADB install -r "$REPO/hrm/hrm.apk"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== DONE: $REPO/hrm/hrm.apk ==="
|
||||||
Reference in New Issue
Block a user