Skip to content

Commit

Permalink
merge latest
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Nov 18, 2024
2 parents 6601eec + 461dd71 commit e7d8b2c
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 224 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: go install github.com/golang/protobuf/protoc-gen-go@latest

- name: Build
env:
GIT_LFS_SKIP_SMUDGE: 1
run: LIB_NAME=liblantern.so make lantern

# Install gotestfmt on the VM running the action.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ All these dependencies must be in your PATH. Some of this is Android specific, s

#### macOS

* `make darwin`
* `make macos`
* `make ffigen`
* `flutter run -d macos`

Expand Down
7 changes: 0 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ android {
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [
TapsellMediationAppKey : "ad680da7-f319-42cb-bdde-3b6c43486eaa",
TapsellMediationAdmobAdapterSignature : "ca-app-pub-2685698271254859~9283700921",
TapsellMediationApplovinAdapterSignature: "YOUR_APPLOVIN_SIGNATURE",
TapsellMediationAppMarket : "GooglePlay",
]

}
kotlin {
jvmToolchain(17)
Expand Down
7 changes: 0 additions & 7 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,3 @@
-keep class org.whispersystems.** { *; }
##---------------End: proguard configuration for Signal ----------
#

##---------------Begin: proguard configuration for Tapsell ----------
-dontwarn ir.tapsell.mediation.flutter.utils.UtilsKt
-keep class ir.tapsell.mediation.flutter.utils.UtilsKt
-keep class ir.tapsell.mediation.flutter.TapsellFlutterPlugin
##---------------End: proguard configuration for Tapsell ----------
#
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ buildscript {
ext.signal_version = '2.8.1'
ext.protoc_version = '4.26.1'
ext.desugarJdk = '2.0.4'
ext.tapsellVersion = '1.0.1-beta07'

repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Binary file added assets/images/tray_dark_connected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray_dark_disconnected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray_light_connected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray_light_disconnected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions desktop/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/getlantern/errors"
"github.com/getlantern/eventual"
"github.com/getlantern/flashlight/v7"
"github.com/getlantern/flashlight/v7/bandit"
flashlightClient "github.com/getlantern/flashlight/v7/client"
"github.com/getlantern/flashlight/v7/config"
"github.com/getlantern/flashlight/v7/dialer"
"github.com/getlantern/flashlight/v7/email"
"github.com/getlantern/flashlight/v7/geolookup"
"github.com/getlantern/flashlight/v7/logging"
Expand Down Expand Up @@ -424,7 +424,7 @@ func (app *App) onConfigUpdate(cfg *config.Global, src config.Source) {
email.SetDefaultRecipient(cfg.ReportIssueEmail)
}

func (app *App) onProxiesUpdate(proxies []bandit.Dialer, src config.Source) {
func (app *App) onProxiesUpdate(proxies []dialer.ProxyDialer, src config.Source) {
log.Debugf("[Startup Desktop] Got proxies update from %v", src)
app.fetchedProxiesConfig.Store(true)
app.hasSucceedingProxy.Store(true)
Expand Down
4 changes: 2 additions & 2 deletions desktop/diagnostics/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/getlantern/diagnostics"
"github.com/getlantern/errors"
"github.com/getlantern/flashlight/v7/bandit"
"github.com/getlantern/flashlight/v7/dialer"
)

const (
Expand All @@ -33,7 +33,7 @@ type Report struct {
}

// Run the diagnostics.
func Run(proxies []bandit.Dialer) Report {
func Run(proxies []dialer.ProxyDialer) Report {
s := newSuite()
s.initAndAdd(func() (*diagnostic, error) {
defaultGateway, err := gateway.DiscoverGateway()
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ require (
github.com/getlantern/eventual v1.0.0
github.com/getlantern/eventual/v2 v2.0.2
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c
github.com/getlantern/flashlight/v7 v7.6.124
github.com/getlantern/fronted v0.0.0-20241028162429-6616677cce5d
github.com/getlantern/flashlight/v7 v7.6.133
github.com/getlantern/fronted v0.0.0-20241106204211-209e8131cbd8
github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65
github.com/getlantern/hidden v0.0.0-20220104173330-f221c5a24770
github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731/go.mod h1:XZwE+
github.com/getlantern/filepersist v0.0.0-20160317154340-c5f0cd24e799/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c h1:mcz27xtAkb1OuOLBct/uFfL1p3XxAIcFct82GbT+UZM=
github.com/getlantern/filepersist v0.0.0-20210901195658-ed29a1cb0b7c/go.mod h1:8DGAx0LNUfXNnEH+fXI0s3OCBA/351kZCiz/8YSK3i8=
github.com/getlantern/flashlight/v7 v7.6.124 h1:7UXgoSNyR6lxy0WIVP1Ddilop0lP0I2ZeYjjEGL6IzY=
github.com/getlantern/flashlight/v7 v7.6.124/go.mod h1:XpFdE7V0Na3Os1ZGVVGopmiTvuOlAfjNEyLQ4CaRmyU=
github.com/getlantern/flashlight/v7 v7.6.133 h1:2BLB+EAfq36XgbGUDtOmiqV1glUcpoOZwem+gyDxacM=
github.com/getlantern/flashlight/v7 v7.6.133/go.mod h1:PNDmAgH5Y3+Gi7Fnl05f1MW1joM+djK5ukKIaEjJMZA=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede h1:yrU6Px3ZkvCsDLPryPGi6FN+2iqFPq+JeCb7EFoDBhw=
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede/go.mod h1:nhnoiS6DE6zfe+BaCMU4YI01UpsuiXnDqM5S8jxHuuI=
github.com/getlantern/fronted v0.0.0-20241028162429-6616677cce5d h1:UyXg0m0jaZV3JBKpn8MImV1RU6uknVkVyLZ+7mOu/dI=
github.com/getlantern/fronted v0.0.0-20241028162429-6616677cce5d/go.mod h1:WByj7b55hNRpeuIaES521Poebt0ABOdzG/9g+bS4BiQ=
github.com/getlantern/fronted v0.0.0-20241106204211-209e8131cbd8 h1:6J3WfWrjfaBsyzeaUpYiAwSeI5Fkl5+TXYEmUSh1el0=
github.com/getlantern/fronted v0.0.0-20241106204211-209e8131cbd8/go.mod h1:WByj7b55hNRpeuIaES521Poebt0ABOdzG/9g+bS4BiQ=
github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 h1:mSg57/+t59Q08AqArlhW+3N1AVPn5ox0dTOYonRps6w=
github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9/go.mod h1:RjQ0krF8NTCc5xo2Q1995/vZBnYg33h8svn15do7dLg=
github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4 h1:Ju9l1RretVWJTNo2vpl/xAW8Dcuiyg5kJC6LRBpCigw=
Expand Down
21 changes: 5 additions & 16 deletions internalsdk/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ import (
"github.com/getlantern/errors"
"github.com/getlantern/eventual/v2"
"github.com/getlantern/flashlight/v7"
"github.com/getlantern/flashlight/v7/bandit"
"github.com/getlantern/flashlight/v7/bandwidth"
"github.com/getlantern/flashlight/v7/client"
"github.com/getlantern/flashlight/v7/config"
"github.com/getlantern/flashlight/v7/dialer"
"github.com/getlantern/flashlight/v7/geolookup"
"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/lantern-client/internalsdk/common"
"github.com/getlantern/mtime"
"github.com/getsentry/sentry-go"

"github.com/getlantern/lantern-client/internalsdk/analytics"
"github.com/getlantern/lantern-client/internalsdk/common"

// import gomobile just to make sure it stays in go.mod
_ "golang.org/x/mobile/bind/java"
)
Expand Down Expand Up @@ -102,7 +103,6 @@ type Session interface {
SetChatEnabled(bool)
SplitTunnelingEnabled() (bool, error)
SetShowGoogleAds(bool)
SetShowTapSellAds(bool)
SetHasConfigFetched(bool)
SetHasProxyFetched(bool)
SetUserIdAndToken(int64, string) error
Expand Down Expand Up @@ -139,7 +139,6 @@ type PanickingSession interface {
SetIP(string)
SplitTunnelingEnabled() bool
SetShowGoogleAds(bool)
SetShowTapSellAds(bool)
// workaround for lack of any sequence types in gomobile bind... ;_;
// used to implement GetInternalHeaders() map[string]string
// Should return a JSON encoded map[string]string {"key":"val","key2":"val", ...}
Expand Down Expand Up @@ -301,10 +300,6 @@ func (s *panickingSessionImpl) SetShowGoogleAds(enabled bool) {
s.wrapped.SetShowGoogleAds(enabled)
}

func (s *panickingSessionImpl) SetShowTapSellAds(enabled bool) {
s.wrapped.SetShowTapSellAds(enabled)
}

func (s *panickingSessionImpl) SetUserIdAndToken(userID int64, token string) {
err := s.wrapped.SetUserIdAndToken(userID, token)
panicIfNecessary(err)
Expand Down Expand Up @@ -568,7 +563,7 @@ func run(configDir, locale string, settings Settings, wrappedSession Session) {
flashlight.WithOnConfig(func(g *config.Global, s config.Source) {
session.SetHasConfigFetched(true)
}),
flashlight.WithOnProxies(func(d []bandit.Dialer, s config.Source) {
flashlight.WithOnProxies(func(d []dialer.ProxyDialer, s config.Source) {
session.SetHasProxyFetched(true)
}),
flashlight.WithOnDialError(func(err error, hasSucceeding bool) {
Expand Down Expand Up @@ -613,15 +608,9 @@ func run(configDir, locale string, settings Settings, wrappedSession Session) {
showAdsEnabled := runner.FeatureEnabled(config.FeatureInterstitialAds, common.ApplicationVersion)
log.Debugf("Feature: Show ads enabled? %v", showAdsEnabled)
session.SetShowGoogleAds(showAdsEnabled)

showTapSellAdsEnabled := runner.FeatureEnabled(config.FeatureTapsellAds, common.ApplicationVersion)
log.Debugf("Feature: Show tapsell ads enabled? %v", showTapSellAdsEnabled)
session.SetShowTapSellAds(showTapSellAdsEnabled)

} else {
// Explicitly disable ads for Pro users.
session.SetShowGoogleAds(false)
session.SetShowTapSellAds(false)
}
}

Expand Down
1 change: 0 additions & 1 deletion internalsdk/android_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func (c testSession) SetAuthEnabled(enabled bool) {}
func (c testSession) SetMatomoEnabled(bool) {}
func (c testSession) IsPlayVersion() (bool, error) { return false, nil }
func (c testSession) SetShowGoogleAds(enabled bool) {}
func (c testSession) SetShowTapSellAds(enabled bool) {}
func (c testSession) SetHasConfigFetched(enabled bool) {}
func (c testSession) SetHasProxyFetched(enabled bool) {}
func (c testSession) SetOnSuccess(enabled bool) {}
Expand Down
3 changes: 2 additions & 1 deletion internalsdk/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/getlantern/flashlight/v7/proxied"
"github.com/getlantern/golog"

"github.com/getlantern/lantern-client/internalsdk/common"
"github.com/getlantern/lantern-client/internalsdk/pro"
"github.com/getlantern/lantern-client/internalsdk/protos"
Expand Down Expand Up @@ -61,7 +62,7 @@ func NewClient(baseURL string, userConfig func() common.UserConfig) AuthClient {
log.Debug("using proxied.Fronted")
//this is ios version
httpClient = &http.Client{
Transport: proxied.Fronted(30 * time.Second),
Transport: proxied.Fronted("auth_fronted_roundtrip", 30*time.Second),
}
} else {
log.Debug("using proxied.ChainedNonPersistent")
Expand Down
14 changes: 7 additions & 7 deletions internalsdk/ios/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (
"github.com/getlantern/dnsgrab"
"github.com/getlantern/dnsgrab/persistentcache"
"github.com/getlantern/errors"
"github.com/getlantern/flashlight/v7/bandit"
"github.com/getlantern/flashlight/v7/bandwidth"
"github.com/getlantern/flashlight/v7/chained"
"github.com/getlantern/flashlight/v7/dialer"
"github.com/getlantern/flashlight/v7/stats"
"github.com/getlantern/ipproxy"

"github.com/getlantern/lantern-client/internalsdk/common"
)

Expand Down Expand Up @@ -115,7 +116,7 @@ type BandwidthTracker interface {
type cw struct {
ipStack io.WriteCloser
client *iosClient
dialer *bandit.BanditDialer
dialer dialer.Dialer
ipp ipproxy.Proxy
quotaTextPath string
lastSavedQuota time.Time
Expand All @@ -136,7 +137,7 @@ func (c *cw) Reconfigure() {
panic(log.Errorf("Unable to load dialers on reconfigure: %v", err))
}

c.dialer, err = bandit.New(bandit.Options{
c.dialer = dialer.New(&dialer.Options{
Dialers: dialers,
})
if err != nil {
Expand Down Expand Up @@ -215,9 +216,8 @@ func (c *iosClient) start() (ClientWriter, error) {
return nil, errors.New("No dialers found")
}
tracker := stats.NewTracker()
dialer, err := bandit.New(bandit.Options{
Dialers: dialers,
StatsTracker: tracker,
dialer := dialer.New(&dialer.Options{
Dialers: dialers,
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -313,7 +313,7 @@ func (c *iosClient) loadUserConfig() error {
return nil
}

func (c *iosClient) loadDialers() ([]bandit.Dialer, error) {
func (c *iosClient) loadDialers() ([]dialer.ProxyDialer, error) {
cf := &configurer{configFolderPath: c.configDir}
chained.PersistSessionStates(c.configDir)

Expand Down
6 changes: 3 additions & 3 deletions internalsdk/ios/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/getlantern/dnsgrab"
"github.com/getlantern/flashlight/v7/bandit"
"github.com/getlantern/flashlight/v7/dialer"
"github.com/getlantern/idletiming"
"github.com/getlantern/netx"
)
Expand All @@ -38,7 +38,7 @@ type proxiedTCPHandler struct {
mx sync.RWMutex
}

func newProxiedTCPHandler(c *iosClient, dialer *bandit.BanditDialer, grabber dnsgrab.Server) *proxiedTCPHandler {
func newProxiedTCPHandler(c *iosClient, dialer dialer.Dialer, grabber dnsgrab.Server) *proxiedTCPHandler {
result := &proxiedTCPHandler{
dialOut: dialer.DialContext,
client: c,
Expand Down Expand Up @@ -66,7 +66,7 @@ func (h *proxiedTCPHandler) handleDial() {
runtime.LockOSThread()

for req := range h.dialRequests {
upstream, err := h.dialOut(req.ctx, bandit.NetworkConnect, req.addr)
upstream, err := h.dialOut(req.ctx, dialer.NetworkConnect, req.addr)
if err == nil {
req.upstream <- upstream
} else {
Expand Down
5 changes: 0 additions & 5 deletions internalsdk/mocks/Session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions internalsdk/session_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const (
pathAcceptedTermsVersion = "accepted_terms_version"
pathAdsEnabled = "adsEnabled"
pathShowAds = "showAds"
pathTapSellAdsEnabled = "tapsellAdsEnabled"
pathStoreVersion = "storeVersion"
pathTestPlayVersion = "testPlayVersion"
pathServerInfo = "/server_info"
Expand Down Expand Up @@ -776,9 +775,6 @@ func (m *SessionModel) checkAvailableFeatures() {
// Check for ads feature
googleAdsEnabled := m.featureEnabled(config.FeatureInterstitialAds)
m.SetShowGoogleAds(googleAdsEnabled)

tapSellAdsEnabled := m.featureEnabled(config.FeatureTapsellAds)
m.SetShowTapSellAds(tapSellAdsEnabled)
}

// check if feature is enabled or not
Expand Down Expand Up @@ -1273,14 +1269,6 @@ func (m *SessionModel) SetShowGoogleAds(adsEnable bool) {
checkAdsEnabled(m)
}

func (m *SessionModel) SetShowTapSellAds(adsEnable bool) {
log.Debugf("SetShowTapSellAds %v", adsEnable)
panicIfNecessary(pathdb.Mutate(m.db, func(tx pathdb.TX) error {
return pathdb.Put(tx, pathTapSellAdsEnabled, adsEnable, "")
}))
checkAdsEnabled(m)
}

func (m *SessionModel) SerializedInternalHeaders() (string, error) {
// Return static for now
// Todo implement this method
Expand Down Expand Up @@ -1564,22 +1552,12 @@ func checkAdsEnabled(session *SessionModel) error {
if err != nil {
return err
}
tapSellAdsEnable, err := pathdb.Get[bool](session.db, pathTapSellAdsEnabled)
if err != nil {
return err
}
if googleAdsEnable {
log.Debug("Google Ads is enabled")
return pathdb.Mutate(session.db, func(tx pathdb.TX) error {
return pathdb.Put[string](tx, pathShowAds, "google", "")
})
}
if tapSellAdsEnable {
log.Debug("TapSell Ads is enabled")
return pathdb.Mutate(session.db, func(tx pathdb.TX) error {
return pathdb.Put[string](tx, pathShowAds, "tapsell", "")
})
}
return nil

}
Expand Down
1 change: 1 addition & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class _LanternAppState extends State<LanternApp>
),
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.black),
),
themeMode: ThemeMode.system,
title: 'app_name'.i18n,
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
Expand Down
Loading

0 comments on commit e7d8b2c

Please sign in to comment.