From 0f4127228393276e517d4a9615dfbfda1fee055e Mon Sep 17 00:00:00 2001 From: Myles Horton Date: Tue, 28 Nov 2023 16:56:43 -0500 Subject: [PATCH] This fixes leftover android-lantern naming along with minor other fixes (#955) * Lots of changes to use new lantern-client naming and small cleanups * make tests compile --- Makefile | 18 +++----- desktop/app/app.go | 77 +++++++++++++++---------------- desktop/app/pro.go | 4 +- desktop/app/settings.go | 4 +- desktop/app/stats_tracker.go | 2 +- desktop/app/sysproxy.go | 2 +- desktop/app/trafficlog.go | 4 +- desktop/cmd/main.go | 23 +++++++-- desktop/go.mod | 4 +- desktop/lib.go | 18 ++++---- desktop/notifier/notifier.go | 2 +- desktop/notifier/notifier_test.go | 2 +- go.mod | 4 +- go.sum | 3 +- internalsdk/android.go | 2 +- internalsdk/replica.go | 6 +-- internalsdk/session_model.go | 4 +- lib/desktop/main.dart | 7 ++- lib/main.dart | 5 +- test/base_screen_test.dart | 2 +- test/signaling_test.dart | 4 +- test/widget_test.dart | 30 ------------ 22 files changed, 105 insertions(+), 122 deletions(-) delete mode 100644 test/widget_test.dart diff --git a/Makefile b/Makefile index b60c35192..3a73beeb0 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ STAGING = false UPDATE_SERVER_URL ?= VERSION ?= 9999.99.99 # Note - we don't bother stripping symbols or DWARF table as Android's packaging seems to take care of that for us -LDFLAGS := -X github.com/getlantern/android-lantern/internalsdk.RevisionDate=$(REVISION_DATE) -X github.com/getlantern/android-lantern/internalsdk.ApplicationVersion=$(VERSION) -X github.com/getlantern/flashlight/v7/common.StagingMode=$(STAGING) +LDFLAGS := -X github.com/getlantern/lantern-client/internalsdk.RevisionDate=$(REVISION_DATE) -X github.com/getlantern/lantern-client/internalsdk.ApplicationVersion=$(VERSION) -X github.com/getlantern/flashlight/v7/common.StagingMode=$(STAGING) # Ref https://pkg.go.dev/cmd/link # -w omits the DWARF table @@ -287,7 +287,7 @@ $(ANDROID_LIB): -androidapi=23 \ -ldflags="$(LDFLAGS)" \ $(GOMOBILE_EXTRA_BUILD_FLAGS) \ - github.com/getlantern/android-lantern/internalsdk github.com/getlantern/pathdb/testsupport github.com/getlantern/pathdb/minisql + github.com/getlantern/lantern-client/internalsdk github.com/getlantern/pathdb/testsupport github.com/getlantern/pathdb/minisql $(MOBILE_ANDROID_LIB): $(ANDROID_LIB) mkdir -p $(MOBILE_LIBS) && \ @@ -425,10 +425,10 @@ changelog: require-version require-changelog require-app # Creates a dump of the source code lantern-android-sources-.tar.gz sourcedump: require-version here=`pwd` && \ - rm -Rf /tmp/android-lantern ; \ - mkdir -p /tmp/android-lantern && \ - cp -R LICENSE LICENSING.md android internalsdk lib protos* go.mod go.sum /tmp/android-lantern && \ - cd /tmp/android-lantern && \ + rm -Rf /tmp/lantern-client ; \ + mkdir -p /tmp/lantern-client && \ + cp -R LICENSE LICENSING.md android internalsdk lib protos* go.mod go.sum /tmp/lantern-client && \ + cd /tmp/lantern-client && \ find . -name "*_test.go" -exec rm {} \; && \ find . -name "*.jks" -exec rm {} \; && \ rm -Rf android/.idea android/sentry.properties android/.settings android/local.properties android/app/.classpath android/app/.project android/app/.settings android/app/src/androidTest android/app/src/test android/app/src/main/res android/app/libs android/.gradle android/alipaySdk-15.6.5-20190718211148/ android/app/bin android/app/.cxx android/app/google-services.json && \ @@ -450,7 +450,7 @@ build-framework: assert-go-version install-gomobile -tags='headless lantern ios' \ -ldflags="$(LDFLAGS)" \ $(GOMOBILE_EXTRA_BUILD_FLAGS) \ - github.com/getlantern/android-lantern/internalsdk github.com/getlantern/pathdb/testsupport github.com/getlantern/pathdb/minisql github.com/getlantern/flashlight/v7/ios + github.com/getlantern/lantern-client/internalsdk github.com/getlantern/pathdb/testsupport github.com/getlantern/pathdb/minisql github.com/getlantern/flashlight/v7/ios @echo "moving framework" mkdir -p $(INTERNALSDK_FRAMEWORK_DIR) mv ./$(INTERNALSDK_FRAMEWORK_NAME) $(INTERNALSDK_FRAMEWORK_DIR)/$(INTERNALSDK_FRAMEWORK_NAME) @@ -476,7 +476,3 @@ clean: rm -f `which gomobile` && \ rm -f `which gobind` rm -Rf "$(FLASHLIGHT_FRAMEWORK_PATH)" "$(INTERMEDIATE_FLASHLIGHT_FRAMEWORK_PATH)" - - - - diff --git a/desktop/app/app.go b/desktop/app/app.go index e4cee6f7f..dc04ec83a 100644 --- a/desktop/app/app.go +++ b/desktop/app/app.go @@ -10,17 +10,12 @@ import ( "sync/atomic" "time" - "github.com/getsentry/sentry-go" . "github.com/anacrolix/generics" + "github.com/getsentry/sentry-go" "github.com/getlantern/dhtup" "github.com/getlantern/errors" - "github.com/getlantern/golog" "github.com/getlantern/eventual" - "github.com/getlantern/i18n" - "github.com/getlantern/memhelper" - notify "github.com/getlantern/notifier" - "github.com/getlantern/profiling" "github.com/getlantern/flashlight/v7" "github.com/getlantern/flashlight/v7/balancer" "github.com/getlantern/flashlight/v7/browsers/simbrowser" @@ -33,44 +28,48 @@ import ( "github.com/getlantern/flashlight/v7/ops" "github.com/getlantern/flashlight/v7/pro" "github.com/getlantern/flashlight/v7/stats" + "github.com/getlantern/golog" + "github.com/getlantern/i18n" + "github.com/getlantern/memhelper" + notify "github.com/getlantern/notifier" + "github.com/getlantern/profiling" "github.com/getlantern/trafficlog-flashlight/tlproc" - "github.com/getlantern/android-lantern/desktop/analytics" - "github.com/getlantern/android-lantern/desktop/features" - "github.com/getlantern/android-lantern/desktop/notifier" - "github.com/getlantern/android-lantern/desktop/server" - "github.com/getlantern/android-lantern/desktop/ws" - uicommon "github.com/getlantern/android-lantern/desktop/common" + "github.com/getlantern/lantern-client/desktop/analytics" + uicommon "github.com/getlantern/lantern-client/desktop/common" + "github.com/getlantern/lantern-client/desktop/features" + "github.com/getlantern/lantern-client/desktop/notifier" + "github.com/getlantern/lantern-client/desktop/server" + "github.com/getlantern/lantern-client/desktop/ws" ) var ( - log = golog.LoggerFor("lantern-desktop.app") - startTime = time.Now() + log = golog.LoggerFor("lantern-desktop.app") + startTime = time.Now() translationAppName = strings.ToUpper(common.DefaultAppName) ) // App is the core of the Lantern desktop application, in the form of a library. type App struct { - hasExited int64 + hasExited int64 fetchedGlobalConfig int32 fetchedProxiesConfig int32 - Flags flashlight.Flags - configDir string - exited eventual.Value + Flags flashlight.Flags + configDir string + exited eventual.Value analyticsSession analytics.Session settings *Settings statsTracker *statsTracker - muExitFuncs sync.RWMutex exitFuncs []func() chGlobalConfigChanged chan bool - ws ws.UIChannel - flashlight *flashlight.Flashlight - dhtupContext Option[dhtup.Context] + ws ws.UIChannel + flashlight *flashlight.Flashlight + dhtupContext Option[dhtup.Context] // If both the trafficLogLock and proxiesLock are needed, the trafficLogLock should be obtained // first. Keeping the order consistent avoids deadlocking. @@ -89,7 +88,7 @@ type App struct { proxies []balancer.Dialer proxiesLock sync.RWMutex - selectedTab Tab + selectedTab Tab selectedTabMu sync.Mutex } @@ -97,13 +96,13 @@ type App struct { func NewApp(flags flashlight.Flags, configDir string, settings *Settings) *App { analyticsSession := newAnalyticsSession(settings) app := &App{ - configDir: configDir, - exited: eventual.NewValue(), - settings: settings, - analyticsSession: analyticsSession, - selectedTab: AccountTab, - statsTracker: NewStatsTracker(), - ws: ws.NewUIChannel(), + configDir: configDir, + exited: eventual.NewValue(), + settings: settings, + analyticsSession: analyticsSession, + selectedTab: AccountTab, + statsTracker: NewStatsTracker(), + ws: ws.NewUIChannel(), } return app @@ -516,14 +515,14 @@ func (app *App) doExit(err error) { if err != nil { log.Errorf("Exiting app %d(%d) because of %v", os.Getpid(), os.Getppid(), err) if ShouldReportToSentry() { - sentry.ConfigureScope(func(scope *sentry.Scope) { - scope.SetLevel(sentry.LevelFatal) - }) - - sentry.CaptureException(err) - if result := sentry.Flush(common.SentryTimeout); !result { - log.Error("Flushing to Sentry timed out") - } + sentry.ConfigureScope(func(scope *sentry.Scope) { + scope.SetLevel(sentry.LevelFatal) + }) + + sentry.CaptureException(err) + if result := sentry.Flush(common.SentryTimeout); !result { + log.Error("Flushing to Sentry timed out") + } } } else { log.Debugf("Exiting app %d(%d)", os.Getpid(), os.Getppid()) @@ -622,5 +621,3 @@ func (app *App) AdTrackURL() string { func (app *App) AddToken(path string) string { return path } - - diff --git a/desktop/app/pro.go b/desktop/app/pro.go index bcd2260b4..0d8359071 100644 --- a/desktop/app/pro.go +++ b/desktop/app/pro.go @@ -8,8 +8,8 @@ import ( "github.com/getlantern/flashlight/v7/pro/client" "github.com/getlantern/golog" - "github.com/getlantern/android-lantern/desktop/deviceid" - "github.com/getlantern/android-lantern/desktop/ws" + "github.com/getlantern/lantern-client/desktop/deviceid" + "github.com/getlantern/lantern-client/desktop/ws" ) // isProUser blocks itself to check if current user is Pro, or !ok if error diff --git a/desktop/app/settings.go b/desktop/app/settings.go index 3631806be..ee2d2b62a 100644 --- a/desktop/app/settings.go +++ b/desktop/app/settings.go @@ -19,8 +19,8 @@ import ( "github.com/getlantern/timezone" "github.com/getlantern/yaml" - "github.com/getlantern/android-lantern/desktop/deviceid" - "github.com/getlantern/android-lantern/desktop/ws" + "github.com/getlantern/lantern-client/desktop/deviceid" + "github.com/getlantern/lantern-client/desktop/ws" ) // SettingName is the name of a setting. diff --git a/desktop/app/stats_tracker.go b/desktop/app/stats_tracker.go index 399c38962..393d52533 100644 --- a/desktop/app/stats_tracker.go +++ b/desktop/app/stats_tracker.go @@ -3,7 +3,7 @@ package app import ( "github.com/getlantern/flashlight/v7/stats" - "github.com/getlantern/android-lantern/desktop/ws" + "github.com/getlantern/lantern-client/desktop/ws" ) type statsTracker struct { diff --git a/desktop/app/sysproxy.go b/desktop/app/sysproxy.go index 4502ebe2d..f4994c032 100644 --- a/desktop/app/sysproxy.go +++ b/desktop/app/sysproxy.go @@ -14,7 +14,7 @@ import ( "github.com/getlantern/flashlight/v7/ops" "github.com/getlantern/sysproxy" - "github.com/getlantern/android-lantern/desktop/icons" + "github.com/getlantern/lantern-client/desktop/icons" ) var ( diff --git a/desktop/app/trafficlog.go b/desktop/app/trafficlog.go index 728283114..b936f3ddc 100644 --- a/desktop/app/trafficlog.go +++ b/desktop/app/trafficlog.go @@ -19,8 +19,8 @@ import ( "github.com/getlantern/trafficlog-flashlight/tlproc" "github.com/getlantern/yaml" - "github.com/getlantern/android-lantern/desktop/features" - "github.com/getlantern/android-lantern/desktop/icons" + "github.com/getlantern/lantern-client/desktop/features" + "github.com/getlantern/lantern-client/desktop/icons" ) const ( diff --git a/desktop/cmd/main.go b/desktop/cmd/main.go index 736c553de..1e2d1aed7 100644 --- a/desktop/cmd/main.go +++ b/desktop/cmd/main.go @@ -3,15 +3,16 @@ package main import ( "os" "os/signal" - "syscall" + "path/filepath" "runtime" "runtime/debug" + "syscall" "github.com/getlantern/appdir" - "github.com/getlantern/android-lantern/desktop/app" "github.com/getlantern/flashlight/v7" "github.com/getlantern/flashlight/v7/common" "github.com/getlantern/golog" + "github.com/getlantern/lantern-client/desktop/app" ) var ( @@ -28,7 +29,8 @@ func main() { flags := flashlight.ParseFlags() cdir := configDir(&flags) - a := app.NewApp(flags, cdir) + settings := loadSettings(cdir) + a := app.NewApp(flags, cdir, settings) log.Debug("Running headless") runApp(a) err := a.WaitForExit() @@ -40,6 +42,19 @@ func main() { os.Exit(0) } +// loadSettings loads the initial settings at startup, either from disk or using defaults. +func loadSettings(configDir string) *app.Settings { + path := filepath.Join(configDir, "settings.yaml") + if common.Staging { + path = filepath.Join(configDir, "settings-staging.yaml") + } + settings := app.LoadSettingsFrom(app.ApplicationVersion, app.RevisionDate, app.BuildDate, path) + if common.Staging { + settings.SetUserIDAndToken(9007199254740992, "OyzvkVvXk7OgOQcx-aZpK5uXx6gQl5i8BnOuUkc0fKpEZW6tc8uUvA") + } + return settings +} + func configDir(flags *flashlight.Flags) string { cdir := flags.ConfigDir if cdir == "" { @@ -77,4 +92,4 @@ func handleSignals(a *app.App) { os.Exit(1) //desktop.QuitSystray(a) }() -} \ No newline at end of file +} diff --git a/desktop/go.mod b/desktop/go.mod index 5f38b8d79..266ef19ca 100644 --- a/desktop/go.mod +++ b/desktop/go.mod @@ -1,4 +1,4 @@ -module github.com/getlantern/android-lantern/desktop +module github.com/getlantern/lantern-client/desktop go 1.21 @@ -40,6 +40,7 @@ require ( github.com/gorilla/websocket v1.5.0 github.com/stretchr/testify v1.8.4 golang.org/x/sys v0.14.0 + google.golang.org/protobuf v1.31.0 ) require ( @@ -258,7 +259,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect howett.net/plist v1.0.0 // indirect modernc.org/libc v1.22.3 // indirect diff --git a/desktop/lib.go b/desktop/lib.go index 1dafda18b..1ed0b3ec6 100644 --- a/desktop/lib.go +++ b/desktop/lib.go @@ -6,27 +6,27 @@ import ( "os" "os/signal" "path/filepath" - "syscall" "runtime" "runtime/debug" "strconv" + "syscall" "github.com/getlantern/appdir" - "github.com/getlantern/android-lantern/desktop/app" - "github.com/getlantern/android-lantern/desktop/pro" "github.com/getlantern/flashlight/v7" "github.com/getlantern/flashlight/v7/common" "github.com/getlantern/golog" + "github.com/getlantern/lantern-client/desktop/app" + "github.com/getlantern/lantern-client/desktop/pro" ) import "C" var ( log = golog.LoggerFor("lantern-desktop.main") - a *app.App + a *app.App proClient *pro.ProClient - settings *app.Settings + settings *app.Settings ) //export Start @@ -44,7 +44,7 @@ func Start() *C.char { proClient = pro.New() a = app.NewApp(flags, cdir, settings) log.Debug("Running headless") - go func() { + go func() { runApp(a) err := a.WaitForExit() if err != nil { @@ -54,19 +54,19 @@ func Start() *C.char { log.Debug("Lantern stopped") os.Exit(0) }() - return C.CString("") + return C.CString("") } //export SysProxyOn func SysProxyOn() *C.char { app.SysproxyOn() - return C.CString("on") + return C.CString("on") } //export SysProxyOff func SysProxyOff() *C.char { app.SysProxyOff() - return C.CString("off") + return C.CString("off") } func userHeaders() (string, string, string) { diff --git a/desktop/notifier/notifier.go b/desktop/notifier/notifier.go index 15d448194..b7a6811f2 100644 --- a/desktop/notifier/notifier.go +++ b/desktop/notifier/notifier.go @@ -8,7 +8,7 @@ import ( notify "github.com/getlantern/notifier" "github.com/getsentry/sentry-go" - "github.com/getlantern/android-lantern/desktop/analytics" + "github.com/getlantern/lantern-client/desktop/analytics" ) const ( diff --git a/desktop/notifier/notifier_test.go b/desktop/notifier/notifier_test.go index f0d37c63e..db66d24a8 100644 --- a/desktop/notifier/notifier_test.go +++ b/desktop/notifier/notifier_test.go @@ -10,7 +10,7 @@ import ( notify "github.com/getlantern/notifier" "github.com/getlantern/flashlight/v7/common" - "github.com/getlantern/android-lantern/desktop/analytics" + "github.com/getlantern/lantern-client/desktop/analytics" ) func TestNotify(t *testing.T) { diff --git a/go.mod b/go.mod index 5dcd65ba9..e5a0d90ca 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/getlantern/android-lantern +module github.com/getlantern/lantern-client go 1.19 @@ -42,6 +42,8 @@ require ( nhooyr.io/websocket v1.8.10 ) +require github.com/montanaflynn/stats v0.6.3 // indirect + require ( crawshaw.io/sqlite v0.3.3-0.20220618202545-d1964889ea3c // indirect filippo.io/edwards25519 v1.0.0 // indirect diff --git a/go.sum b/go.sum index 776141241..e3df61f2f 100644 --- a/go.sum +++ b/go.sum @@ -760,8 +760,9 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/montanaflynn/stats v0.5.0 h1:2EkzeTSqBB4V4bJwWrt5gIIrZmpJBcoIRGS2kWLgzmk= github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.6.3 h1:F8446DrvIF5V5smZfZ8K9nrmmix0AFgevPdLruGOmzk= +github.com/montanaflynn/stats v0.6.3/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= diff --git a/internalsdk/android.go b/internalsdk/android.go index 9a50b656e..0286dd35c 100644 --- a/internalsdk/android.go +++ b/internalsdk/android.go @@ -11,7 +11,6 @@ import ( "sync" "time" - "github.com/getlantern/android-lantern/internalsdk/analytics" "github.com/getlantern/appdir" "github.com/getlantern/autoupdate" "github.com/getlantern/dnsgrab" @@ -28,6 +27,7 @@ import ( "github.com/getlantern/flashlight/v7/logging" "github.com/getlantern/flashlight/v7/ops" "github.com/getlantern/golog" + "github.com/getlantern/lantern-client/internalsdk/analytics" "github.com/getlantern/mtime" // import gomobile just to make sure it stays in go.mod diff --git a/internalsdk/replica.go b/internalsdk/replica.go index ad7abc696..c19a01a7b 100644 --- a/internalsdk/replica.go +++ b/internalsdk/replica.go @@ -21,8 +21,8 @@ import ( replicaServer "github.com/getlantern/replica/server" replicaService "github.com/getlantern/replica/service" - "github.com/getlantern/android-lantern/internalsdk/analytics" - "github.com/getlantern/android-lantern/internalsdk/doh" + "github.com/getlantern/lantern-client/internalsdk/analytics" + "github.com/getlantern/lantern-client/internalsdk/doh" "github.com/gorilla/mux" ) @@ -137,7 +137,7 @@ func (s *ReplicaServer) newHandler() (*replicaServer.HttpHandler, error) { input.RootUploadsDir = s.ConfigDir // XXX <16-12-21, soltzen> Those three flags make sure that uploads are not // saved to the torrent client, saved locally, or have any metadata - // generated for them. This decision is only for android-lantern to protect + // generated for them. This decision is only for lantern-client to protect // the privacy of uploaders input.AddUploadsToTorrentClient = false input.StoreUploadsLocally = false diff --git a/internalsdk/session_model.go b/internalsdk/session_model.go index 724bf9d98..25754c4d6 100644 --- a/internalsdk/session_model.go +++ b/internalsdk/session_model.go @@ -5,11 +5,11 @@ import ( "path/filepath" "strconv" - "github.com/getlantern/android-lantern/internalsdk/apimodels" - "github.com/getlantern/android-lantern/internalsdk/protos" "github.com/getlantern/errors" "github.com/getlantern/flashlight/v7/common" "github.com/getlantern/flashlight/v7/logging" + "github.com/getlantern/lantern-client/internalsdk/apimodels" + "github.com/getlantern/lantern-client/internalsdk/protos" "github.com/getlantern/pathdb" "github.com/getlantern/pathdb/minisql" ) diff --git a/lib/desktop/main.dart b/lib/desktop/main.dart index 6287f922a..94da532fd 100644 --- a/lib/desktop/main.dart +++ b/lib/desktop/main.dart @@ -1,7 +1,6 @@ -import 'package:flutter/foundation.dart' show debugDefaultTargetPlatformOverride; +import 'package:flutter/foundation.dart' + show debugDefaultTargetPlatformOverride; import 'package:flutter/material.dart'; -import 'package:lantern/flutter_go.dart'; -import 'package:flutter/services.dart'; import 'package:lantern/desktop/app.dart'; import 'package:lantern/desktop/ffi.dart'; import 'package:system_tray/system_tray.dart'; @@ -10,5 +9,5 @@ Future main() async { debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; WidgetsFlutterBinding.ensureInitialized(); loadLibrary(); - runApp(DesktopApp()); + runApp(const DesktopApp()); } diff --git a/lib/main.dart b/lib/main.dart index e0ca45a9e..3aef72c3e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,8 @@ import 'catcher_setup.dart'; Future main() async { // CI will be true only when running appium test - const String flavor = String.fromEnvironment('app.flavor');; + const String flavor = String.fromEnvironment('app.flavor'); + print("Running Flavor $flavor"); if (flavor == 'appiumTest') { print("Flutter extension enabled $flavor"); @@ -15,7 +16,7 @@ Future main() async { WidgetsFlutterBinding.ensureInitialized(); - await initPlatformState(); + //await initPlatformState(); //await _initGoogleMobileAds(); //await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); diff --git a/test/base_screen_test.dart b/test/base_screen_test.dart index 12a7ce715..4f00798f0 100644 --- a/test/base_screen_test.dart +++ b/test/base_screen_test.dart @@ -55,7 +55,7 @@ void main() { ], ), // TODO <08-08-22, kalli> Confirm we can use BotToast - builder: BotToastInit(), + //builder: BotToastInit(), supportedLocales: [ const Locale('ar', 'EG'), const Locale('fr', 'FR'), diff --git a/test/signaling_test.dart b/test/signaling_test.dart index e0b4d56bf..c09eb9b6a 100644 --- a/test/signaling_test.dart +++ b/test/signaling_test.dart @@ -1,7 +1,8 @@ -import 'package:lantern/messaging/calls/signaling.dart'; +//import 'package:lantern/messaging/calls/signaling.dart'; import 'package:test/test.dart'; void main() { + /* group('forceOpus()', () { test('opus available, force', () { final expected = sdp @@ -37,6 +38,7 @@ void main() { expect(tuneOpus(sdpWithoutAudio, force: true), sdpWithoutAudio); }); }); + */ } final sdp = ''' diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 146b88b84..000000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:androidlantern/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}