Skip to content

Commit

Permalink
Upgrade SDK and add more models (#7)
Browse files Browse the repository at this point in the history
* Upgrade SDK and add more models
* Migrate secrets from Storage to App Settings as password fields
* Cleanup code and remove warnings
* Add github actions
* Min API level 2.4.0 - remove unsupported models
  • Loading branch information
jctim authored Sep 19, 2024
1 parent f2c30c5 commit 90579d5
Show file tree
Hide file tree
Showing 40 changed files with 263 additions and 194 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Makefile CI

on:
push:
branches: [ "version-2" ]
pull_request:
branches: [ "version-2" ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CIQ_SDK_VERSION: 6.2.0

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Generate a developer key
run: |
openssl genrsa -out developer_key.pem 4096
openssl pkcs8 -topk8 -inform PEM -outform DER -in developer_key.pem -out developer_key.der -nocrypt
- name: Download and configure ConnectIQ SDK
env:
GARMIN_USERNAME: ${{ secrets.GARMIN_USERNAME }}
GARMIN_PASSWORD: ${{ secrets.GARMIN_PASSWORD }}
run: |
curl -s https://raw.githubusercontent.com/lindell/connect-iq-sdk-manager-cli/master/install.sh | sh -s -- -d v0.7.1
connect-iq-sdk-manager agreement view >> agreement.txt
HASH=`grep -Po 'Current Hash: \K.*' agreement.txt`
connect-iq-sdk-manager agreement accept --agreement-hash=$HASH
connect-iq-sdk-manager login
connect-iq-sdk-manager sdk set $CIQ_SDK_VERSION
connect-iq-sdk-manager device download --manifest=manifest.xml
- name: Create properties.mk
run: |
touch properties.mk
echo "SDK_HOME = `connect-iq-sdk-manager sdk current-path`" >> properties.mk
echo "DEVELOPER_KEY = `pwd`/developer_key.der" >> properties.mk
echo "cat properties.mk"
cat properties.mk
- name: Build
run: make buildall

- name: Package
run: make package
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.idea/
*.iml
.lh/
.vscode/
*.iml

out/
output/
bin/

properties.mk
23 changes: 11 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
include properties.mk

sources = `find source -name '*.mc'`
resources = `find resources* -name '*.xml' | tr '\n' ':' | sed 's/.$$//'`
appName = `grep entry manifest.xml | sed 's/.*entry="\([^"]*\).*/\1/'`
all_devices = `grep -Po 'product id="\K[^"]*' manifest.xml | tr '\n' ' '`

build:
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName).prg \
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName)-$(DEVICE).prg \
-f ./monkey.jungle \
-y $(DEVELOPER_KEY) \
-d $(DEVICE)

build-test:
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName)-test.prg \
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName)-$(DEVICE)-test.prg \
-f ./monkey.jungle \
--unit-test \
-y $(DEVELOPER_KEY) \
-d $(DEVICE)

buildall:
@for device in $(SUPPORTED_DEVICES_LIST); do \
@for device in $(all_devices); do \
echo "-----"; \
echo "Building for" $$device; \
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName)-$$device.prg \
-f ./monkey.jungle \
-y $(DEVELOPER_KEY) \
-d $$device; \
$(SDK_HOME)/bin/monkeyc --warn --output bin/$(appName)-$$device.prg \
-f ./monkey.jungle \
-y $(DEVELOPER_KEY) \
-d $$device || exit 1; \
done

run: build
@$(SDK_HOME)/bin/connectiq &&\
$(SDK_HOME)/bin/monkeydo bin/$(appName).prg $(DEVICE)
$(SDK_HOME)/bin/monkeydo bin/$(appName)-$(DEVICE).prg $(DEVICE)

test: build-test
@$(SDK_HOME)/bin/connectiq &&\
$(SDK_HOME)/bin/monkeydo bin/$(appName)-test.prg $(DEVICE) -t
$(SDK_HOME)/bin/monkeydo bin/$(appName)-$(DEVICE)-test.prg $(DEVICE) -t

clean:
@rm -rf bin/*

deploy: build
@cp bin/$(appName).prg $(DEPLOY)
@cp bin/$(appName)-$(DEVICE).prg $(DEPLOY)

package:
@$(SDK_HOME)/bin/monkeyc --warn -e --output bin/$(appName).iq \
Expand Down
105 changes: 83 additions & 22 deletions manifest.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,119 @@
<?xml version="1.0"?>
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
<iq:application id="21DC994D340147388FB6414CE2078737" name="@Strings.AppName" launcherIcon="@Drawables.LauncherIcon"
entry="OtpApp" type="widget" minSdkVersion="2.0.0">

entry="OtpApp" type="widget" minSdkVersion="2.4.0">
<iq:products>
<iq:product id="approachs60"/>
<iq:product id="d2bravo"/>
<iq:product id="d2bravo_titanium"/>
<iq:product id="approachs62"/>
<iq:product id="approachs7042mm"/>
<iq:product id="approachs7047mm"/>
<iq:product id="d2air"/>
<iq:product id="d2airx10"/>
<iq:product id="d2charlie"/>
<iq:product id="d2delta"/>
<iq:product id="d2deltapx"/>
<iq:product id="d2deltas"/>
<iq:product id="d2mach1"/>
<iq:product id="descentg1"/>
<iq:product id="descentmk1"/>

<iq:product id="fr245"/>
<iq:product id="fr245m"/>
<iq:product id="fr645"/>
<iq:product id="fr645m"/>
<!--iq:product id="fr735xt"/-->
<iq:product id="fr935"/>
<iq:product id="fr945"/>

<iq:product id="fenix3"/>
<iq:product id="fenix3_hr"/>

<iq:product id="descentmk2"/>
<iq:product id="descentmk2s"/>
<iq:product id="descentmk343mm"/>
<iq:product id="descentmk351mm"/>
<iq:product id="enduro"/>
<iq:product id="enduro3"/>
<iq:product id="epix2"/>
<iq:product id="epix2pro42mm"/>
<iq:product id="epix2pro47mm"/>
<iq:product id="epix2pro51mm"/>
<iq:product id="fenix5"/>
<iq:product id="fenix5plus"/>
<iq:product id="fenix5s"/>
<iq:product id="fenix5splus"/>
<iq:product id="fenix5x"/>
<iq:product id="fenix5xplus"/>

<iq:product id="fenix6"/>
<iq:product id="fenix6pro"/>
<iq:product id="fenix6s"/>
<iq:product id="fenix6spro"/>
<iq:product id="fenix6xpro"/>

<iq:product id="fenix7"/>
<iq:product id="fenix7pro"/>
<iq:product id="fenix7pronowifi"/>
<iq:product id="fenix7s"/>
<iq:product id="fenix7spro"/>
<iq:product id="fenix7x"/>
<iq:product id="fenix7xpro"/>
<iq:product id="fenix7xpronowifi"/>
<iq:product id="fenix843mm"/>
<iq:product id="fenix847mm"/>
<iq:product id="fenix8solar47mm"/>
<iq:product id="fenix8solar51mm"/>
<iq:product id="fenixchronos"/>

<iq:product id="fenixe"/>
<iq:product id="fr165"/>
<iq:product id="fr165m"/>
<iq:product id="fr245"/>
<iq:product id="fr245m"/>
<iq:product id="fr255"/>
<iq:product id="fr255m"/>
<iq:product id="fr255s"/>
<iq:product id="fr255sm"/>
<iq:product id="fr265"/>
<iq:product id="fr265s"/>
<iq:product id="fr55"/>
<iq:product id="fr645"/>
<iq:product id="fr645m"/>
<iq:product id="fr735xt"/>
<iq:product id="fr745"/>
<iq:product id="fr935"/>
<iq:product id="fr945"/>
<iq:product id="fr945lte"/>
<iq:product id="fr955"/>
<iq:product id="fr965"/>
<iq:product id="instinct2"/>
<iq:product id="instinct2s"/>
<iq:product id="instinct2x"/>
<iq:product id="instinctcrossover"/>
<iq:product id="legacyherocaptainmarvel"/>
<iq:product id="legacyherofirstavenger"/>

<iq:product id="legacysagadarthvader"/>
<iq:product id="legacysagarey"/>
<iq:product id="marq2"/>
<iq:product id="marq2aviator"/>
<iq:product id="marqadventurer"/>
<iq:product id="marqathlete"/>
<iq:product id="marqaviator"/>
<iq:product id="marqcaptain"/>
<iq:product id="marqcommander"/>
<iq:product id="marqdriver"/>
<iq:product id="marqexpedition"/>
<iq:product id="marqgolfer"/>
<iq:product id="venu"/>
<iq:product id="venu2"/>
<iq:product id="venu2plus"/>
<iq:product id="venu2s"/>
<iq:product id="venu3"/>
<iq:product id="venu3s"/>
<iq:product id="venud"/>
<iq:product id="venusq"/>
<iq:product id="venusq2"/>
<iq:product id="venusq2m"/>
<iq:product id="venusqm"/>
<iq:product id="vivoactive3"/>
<iq:product id="vivoactive3d"/>
<iq:product id="vivoactive3m"/>
<iq:product id="vivoactive3mlte"/>
<iq:product id="vivoactive4"/>
<iq:product id="vivoactive4s"/>
<iq:product id="vivoactive5"/>
<iq:product id="vivoactive_hr"/>
</iq:products>
<iq:permissions/>
<iq:languages>
<iq:language>eng</iq:language>
</iq:languages>
<iq:barrels/>
</iq:application>
</iq:manifest>

</iq:manifest>
1 change: 0 additions & 1 deletion properties.mk.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DEVICE = vivoactive3
SDK_HOME = /path/to/connectiq-sdk-mac-2.4.1
DEPLOY = /Volumes/GARMIN/GARMIN/APPS/
SUPPORTED_DEVICES_LIST = fenix3 fenix3_hr fenix5 fenix5s fenix5x vivoactive3
DEVELOPER_KEY = /path/to/developer_key
3 changes: 0 additions & 3 deletions resources-approachs60/drawables/drawables.xml

This file was deleted.

Binary file removed resources-approachs60/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-fenix5s/drawables/drawables.xml

This file was deleted.

Binary file removed resources-fenix5s/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-fenixchronos/drawables/drawables.xml

This file was deleted.

Binary file removed resources-fenixchronos/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-legacyherocaptainmarvel/drawables/drawables.xml

This file was deleted.

Binary file not shown.
3 changes: 0 additions & 3 deletions resources-legacyherofirstavenger/drawables/drawables.xml

This file was deleted.

Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive3/drawables/drawables.xml

This file was deleted.

Binary file removed resources-vivoactive3/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive3d/drawables/drawables.xml

This file was deleted.

Binary file removed resources-vivoactive3d/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive3m/drawables/drawables.xml

This file was deleted.

Binary file removed resources-vivoactive3m/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive3mlte/drawables/drawables.xml

This file was deleted.

Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive4/drawables/drawables.xml

This file was deleted.

Binary file removed resources-vivoactive4/drawables/launcher_icon.png
Binary file not shown.
3 changes: 0 additions & 3 deletions resources-vivoactive4s/drawables/drawables.xml

This file was deleted.

Binary file removed resources-vivoactive4s/drawables/launcher_icon.png
Binary file not shown.
Loading

0 comments on commit 90579d5

Please sign in to comment.