1
1
package android
2
2
3
3
import (
4
- "github.com/netbirdio/netbird/client/internal"
4
+ "github.com/netbirdio/netbird/client/internal/profilemanager "
5
5
)
6
6
7
7
// Preferences exports a subset of the internal config for gomobile
8
8
type Preferences struct {
9
- configInput internal .ConfigInput
9
+ configInput profilemanager .ConfigInput
10
10
}
11
11
12
12
// NewPreferences creates a new Preferences instance
13
13
func NewPreferences (configPath string ) * Preferences {
14
- ci := internal .ConfigInput {
14
+ ci := profilemanager .ConfigInput {
15
15
ConfigPath : configPath ,
16
16
}
17
17
return & Preferences {ci }
@@ -23,7 +23,7 @@ func (p *Preferences) GetManagementURL() (string, error) {
23
23
return p .configInput .ManagementURL , nil
24
24
}
25
25
26
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
26
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
27
27
if err != nil {
28
28
return "" , err
29
29
}
@@ -41,7 +41,7 @@ func (p *Preferences) GetAdminURL() (string, error) {
41
41
return p .configInput .AdminURL , nil
42
42
}
43
43
44
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
44
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
45
45
if err != nil {
46
46
return "" , err
47
47
}
@@ -59,7 +59,7 @@ func (p *Preferences) GetPreSharedKey() (string, error) {
59
59
return * p .configInput .PreSharedKey , nil
60
60
}
61
61
62
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
62
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
63
63
if err != nil {
64
64
return "" , err
65
65
}
@@ -82,7 +82,7 @@ func (p *Preferences) GetRosenpassEnabled() (bool, error) {
82
82
return * p .configInput .RosenpassEnabled , nil
83
83
}
84
84
85
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
85
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
86
86
if err != nil {
87
87
return false , err
88
88
}
@@ -100,7 +100,7 @@ func (p *Preferences) GetRosenpassPermissive() (bool, error) {
100
100
return * p .configInput .RosenpassPermissive , nil
101
101
}
102
102
103
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
103
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
104
104
if err != nil {
105
105
return false , err
106
106
}
@@ -113,7 +113,7 @@ func (p *Preferences) GetDisableClientRoutes() (bool, error) {
113
113
return * p .configInput .DisableClientRoutes , nil
114
114
}
115
115
116
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
116
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
117
117
if err != nil {
118
118
return false , err
119
119
}
@@ -131,7 +131,7 @@ func (p *Preferences) GetDisableServerRoutes() (bool, error) {
131
131
return * p .configInput .DisableServerRoutes , nil
132
132
}
133
133
134
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
134
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
135
135
if err != nil {
136
136
return false , err
137
137
}
@@ -149,7 +149,7 @@ func (p *Preferences) GetDisableDNS() (bool, error) {
149
149
return * p .configInput .DisableDNS , nil
150
150
}
151
151
152
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
152
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
153
153
if err != nil {
154
154
return false , err
155
155
}
@@ -167,7 +167,7 @@ func (p *Preferences) GetDisableFirewall() (bool, error) {
167
167
return * p .configInput .DisableFirewall , nil
168
168
}
169
169
170
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
170
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
171
171
if err != nil {
172
172
return false , err
173
173
}
@@ -185,7 +185,7 @@ func (p *Preferences) GetServerSSHAllowed() (bool, error) {
185
185
return * p .configInput .ServerSSHAllowed , nil
186
186
}
187
187
188
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
188
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
189
189
if err != nil {
190
190
return false , err
191
191
}
@@ -207,7 +207,7 @@ func (p *Preferences) GetBlockInbound() (bool, error) {
207
207
return * p .configInput .BlockInbound , nil
208
208
}
209
209
210
- cfg , err := internal .ReadConfig (p .configInput .ConfigPath )
210
+ cfg , err := profilemanager .ReadConfig (p .configInput .ConfigPath )
211
211
if err != nil {
212
212
return false , err
213
213
}
@@ -221,6 +221,6 @@ func (p *Preferences) SetBlockInbound(block bool) {
221
221
222
222
// Commit writes out the changes to the config file
223
223
func (p * Preferences ) Commit () error {
224
- _ , err := internal .UpdateOrCreateConfig (p .configInput )
224
+ _ , err := profilemanager .UpdateOrCreateConfig (p .configInput )
225
225
return err
226
226
}
0 commit comments