mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
Use app-provided cache directory for os.CreateTemp instead of os.TempDir() which resolves to /data/local/tmp/ on Android — a directory not writable by regular apps. Thread TempDir through GeneratorDependencies -> BundleGenerator and MobileDependency -> EngineConfig so the Android client can pass its cache directory from PlatformFiles.CacheDir().
30 lines
860 B
Go
30 lines
860 B
Go
package internal
|
|
|
|
import (
|
|
"net/netip"
|
|
|
|
"github.com/netbirdio/netbird/client/iface/device"
|
|
"github.com/netbirdio/netbird/client/internal/dns"
|
|
"github.com/netbirdio/netbird/client/internal/listener"
|
|
"github.com/netbirdio/netbird/client/internal/stdnet"
|
|
)
|
|
|
|
// MobileDependency collect all dependencies for mobile platform
|
|
type MobileDependency struct {
|
|
// Android only
|
|
TunAdapter device.TunAdapter
|
|
IFaceDiscover stdnet.ExternalIFaceDiscover
|
|
NetworkChangeListener listener.NetworkChangeListener
|
|
HostDNSAddresses []netip.AddrPort
|
|
DnsReadyListener dns.ReadyListener
|
|
|
|
// iOS only
|
|
DnsManager dns.IosDnsManager
|
|
FileDescriptor int32
|
|
StateFilePath string
|
|
|
|
// TempDir is a writable directory for temporary files (e.g., debug bundle zip).
|
|
// On Android, this should be set to the app's cache directory.
|
|
TempDir string
|
|
}
|