Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 8288563

Browse files
authored
Merge pull request #3 from plgd-dev/android
updates to build aar for gomobile
2 parents a590348 + 6628749 commit 8288563

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

native/OCFClient.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import (
1616
)
1717

1818
type (
19-
// OCFClient for working with devices
20-
OCFClient struct {
19+
// Ocfclient for working with devices
20+
Ocfclient struct {
2121
localClient *local.Client
2222
// add fields here
2323
}
2424
)
2525

2626
// Initialize creates and initializes new local client
27-
func (c *OCFClient) Initialize() error {
27+
func (c *Ocfclient) Initialize() error {
2828
appCallback, err := app.NewApp(&app.AppConfig{
2929
RootCA: lets,
3030
Manufacturer: &app.ManufacturerCerts{
@@ -63,7 +63,7 @@ func (c *OCFClient) Initialize() error {
6363
}
6464

6565
// Discover devices in the local area
66-
func (c *OCFClient) Discover() (string, error) {
66+
func (c *Ocfclient) Discover() (string, error) {
6767
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
6868
defer cancel()
6969
res, err := c.localClient.GetDevices(ctx, local.WithGetDetails(getCloudConfiguration))
@@ -106,7 +106,7 @@ func getCloudConfiguration(ctx context.Context, device *core.Device, links schem
106106
}
107107

108108
// OwnDevice transfers the ownersip of the device to user represented by the token
109-
func (c *OCFClient) OwnDevice(deviceID, token string) error {
109+
func (c *Ocfclient) OwnDevice(deviceID, token string) error {
110110
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
111111
defer cancel()
112112
ctx = kitGrpc.CtxWithToken(ctx, token)
@@ -119,7 +119,7 @@ func (c *OCFClient) OwnDevice(deviceID, token string) error {
119119
}
120120

121121
// OnboardDevice registers the device to the Go-OCF Cloud
122-
func (c *OCFClient) OnboardDevice(deviceID, authorizationProvider, cloudURL, authCode, cloudID string) error {
122+
func (c *Ocfclient) OnboardDevice(deviceID, authorizationProvider, cloudURL, authCode, cloudID string) error {
123123
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
124124
defer cancel()
125125
err := c.localClient.OnboardDevice(ctx, deviceID, authorizationProvider, cloudURL, authCode, cloudID)
@@ -131,7 +131,7 @@ func (c *OCFClient) OnboardDevice(deviceID, authorizationProvider, cloudURL, aut
131131
}
132132

133133
// OffboardDevice deregisters the device from the cloud where it's connected to
134-
func (c *OCFClient) OffboardDevice(deviceID string) error {
134+
func (c *Ocfclient) OffboardDevice(deviceID string) error {
135135
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
136136
defer cancel()
137137
err := c.localClient.OffboardDevice(ctx, deviceID)
@@ -143,7 +143,7 @@ func (c *OCFClient) OffboardDevice(deviceID string) error {
143143
}
144144

145145
// DisownDevice removes the current ownership
146-
func (c *OCFClient) DisownDevice(deviceID string) error {
146+
func (c *Ocfclient) DisownDevice(deviceID string) error {
147147
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
148148
defer cancel()
149149
err := c.localClient.DisownDevice(ctx, deviceID)

native/build-android.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CC=C:/Users/admin/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang gomobile bind --target android -bundleid com.go-ocf -o ../android/libs/go.ocfclient.gojni.aar

native/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ go 1.14
55
require (
66
github.com/go-ocf/kit v0.0.0-20200408211624-bfa7f116ff71
77
github.com/go-ocf/sdk v0.0.0-20200409112144-f306e826ae33
8-
golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007 // indirect
8+
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de // indirect
99
)

native/go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,12 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
438438
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
439439
golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007 h1:JxsyO7zPDWn1rBZW8FV5RFwCKqYeXnyaS/VQPLpXu6I=
440440
golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
441+
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4=
442+
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
441443
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
442444
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
443445
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
446+
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd h1:ePuNC7PZ6O5BzgPn9bZayERXBdfZjUYoXEf5BTfDfh8=
444447
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
445448
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
446449
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
progress_dialog: ^1.1.0+1
2525
shared_preferences: ^0.5.6+3
2626
barcode_scan: ^2.0.1 # https://pub.dev/packages/barcode_scan
27-
flutter_svg: ^0.17.4
27+
flutter_svg: ^0.18.0
2828
http: ^0.12.0+4
2929
flutter_spinkit: "^2.1.0"
3030
fluttertoast: ^4.0.0

0 commit comments

Comments
 (0)