Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into atavism/desktop-notif…
Browse files Browse the repository at this point in the history
…ications
  • Loading branch information
atavism committed May 29, 2024
2 parents fe465a5 + bef437c commit 29d2280
Show file tree
Hide file tree
Showing 69 changed files with 2,366 additions and 433 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ build-framework: assert-go-version install-gomobile
-tags='headless lantern ios netgo' \
-ldflags="$(LDFLAGS)" \
$(GOMOBILE_EXTRA_BUILD_FLAGS) \
github.com/getlantern/lantern-client/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/lantern-client/internalsdk/ios
@echo "moving framework"
mkdir -p $(INTERNALSDK_FRAMEWORK_DIR)
mv ./$(INTERNALSDK_FRAMEWORK_NAME) $(INTERNALSDK_FRAMEWORK_DIR)/$(INTERNALSDK_FRAMEWORK_NAME)
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Note - you might see an error like `Can't load Kernel binary: Invalid SDK hash.`

### Dependencies

All those dependencies must be in your PATH
All these dependencies must be in your PATH. Some of this is Android specific, see below for other platforms.

* Java 11 or greater
* [Android Studio](https://developer.android.com/studio?_gl=1*1wowe6v*_up*MQ..&gclid=Cj0KCQjw6auyBhDzARIsALIo6v-bn0juONfkfmQAJtwssRCQWADJMgGfRBisMNTSXHt5CZnyZVSK2Y8aAgCmEALw_wcB&gclsrc=aw.ds) (Android Studio Jellyfish | 2023.3.1 Patch 1)
Expand All @@ -51,7 +51,8 @@ All those dependencies must be in your PATH

* Install all prerequisites
* Run `git submodule update --init --recursive`
* Run `git lfs install && git pull`
* Run `git lfs install && git pull`.
* Put the [app.env](https://my.1password.com/vaults/all/allitems/adqasjh2hspgjgvgfllyekhcrq) file from 1Password in the repo root.
* Go to the **SDK MANAGER**
* Select **Android SDK**
* Check the SDK from android 5.0(LOLLIPOP) up to the Latest Version at the moment.
Expand All @@ -77,7 +78,6 @@ All those dependencies must be in your PATH
* `flutter pub get`
* `flutter run --flavor prod`


### 🍏 Running the project on iOS

* `make build-framework` (you need to generated Internalsdk.xcframework. containing the Go backend code in order for the project to compile.)
Expand All @@ -86,18 +86,25 @@ All those dependencies must be in your PATH

**Note**: If you're using an M1 or M2 chip, navigate to the ios folder and run `arch -x86_64 pod install`


### 💻 Running the Project on Desktop

**Note**: Make sure to run all the commands from the root of the project.

* Macos run`make darwin` Windows run `make windows` Linux run `linux-amd64`
#### macOS

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

#### Other OS

* Windows run `make windows` Linux run `linux-amd64`
* `make ffigen`
* `flutter pub get`
* `flutter run --flavor prod` or if you are using android studio use desktop configuration


### Running on emulators

You can easily run emulators directly from the command line with the following:

* `flutter devices`
Expand All @@ -124,7 +131,6 @@ You'll need Ruby >= 2.3 installed and `colorize` gem (i.e., `gem install coloriz

### Building the InternalSdk (AKA Lantern Core) as a library


The core Lantern functionality is written in Go and lives in `./internalsdk`.
It is compiled from Go using [Gomobile](https://github.com/golang/mobile) to appropriate formats for each platform.

Expand All @@ -138,7 +144,6 @@ It is compiled from Go using [Gomobile](https://github.com/golang/mobile) to app

For compiled code lives in `./ios/internalsdk/` and is called `Internalsdk.xcframework`.


#### Desktop
The desktop app lives under `desktop` .. To build the Go shared library on macOS:

Expand Down
11 changes: 7 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ replace github.com/eycorsican/go-tun2socks => github.com/getlantern/go-tun2socks

require (
github.com/blang/semver v3.5.1+incompatible
github.com/dustin/go-humanize v1.0.1
github.com/eycorsican/go-tun2socks v1.16.12-0.20201107203946-301549c435ff
github.com/fsnotify/fsnotify v1.6.0
github.com/getlantern/appdir v0.0.0-20200615192800-a0ef1968f4da
github.com/getlantern/autoupdate v0.0.0-20211217175350-d0b211f39ba7
github.com/getlantern/common v1.2.1-0.20230427204521-6ac18c21db39
github.com/getlantern/diagnostics v0.0.0-20230503185158-c2fc28ed22fe
github.com/getlantern/dnsgrab v0.0.0-20240124035712-497ccf435858
github.com/getlantern/errors v1.0.5-0.20240410211607-f268a297d5d1
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.78
github.com/getlantern/flashlight/v7 v7.6.79
github.com/getlantern/fronted v0.0.0-20230601004823-7fec719639d8
github.com/getlantern/golog v0.0.0-20230503153817-8e72de7e0a65
github.com/getlantern/i18n v0.0.0-20181205222232-2afc4f49bb1c
github.com/getlantern/idletiming v0.0.0-20231030193830-6767b09f86db
Expand All @@ -53,6 +58,7 @@ require (
github.com/getlantern/pathdb v0.0.0-20231026090702-54ee1ddd99eb
github.com/getlantern/profiling v0.0.0-20160317154340-2a15afbadcff
github.com/getlantern/replica v0.14.3
github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627
github.com/getlantern/sysproxy v0.0.0-20230319110552-63a8cacb7b9b
github.com/getlantern/timezone v0.0.0-20210901200113-3f9de9d360c9
github.com/getlantern/yaml v0.0.0-20190801163808-0c9bb1ebf426
Expand Down Expand Up @@ -125,7 +131,6 @@ require (
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dsoprea/go-png-image-structure v0.0.0-20210512210324-29b889a6093d // indirect
github.com/dsoprea/go-utility v0.0.0-20221003172846-a3e1774ef349 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvyukov/go-fuzz v0.0.0-20240203152606-b1ce7bc07150 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/enobufs/go-nats v0.0.1 // indirect
Expand All @@ -139,7 +144,6 @@ require (
github.com/getlantern/cmux v0.0.0-20230301223233-dac79088a4c0 // indirect
github.com/getlantern/cmux/v2 v2.0.0-20230301223233-dac79088a4c0 // indirect
github.com/getlantern/cmuxprivate v0.0.0-20231025143958-503c5330c30b // indirect
github.com/getlantern/common v1.2.1-0.20230427204521-6ac18c21db39 // indirect
github.com/getlantern/context v0.0.0-20220418194847-3d5e7a086201 // indirect
github.com/getlantern/detour v0.0.0-20230503144615-d3106a68f79e // indirect
github.com/getlantern/dhtup v0.0.0-20230218071625-e78bcd432e4b // indirect
Expand All @@ -151,7 +155,6 @@ require (
github.com/getlantern/event v0.0.0-20210901195647-a7e3145142e6 // indirect
github.com/getlantern/fdcount v0.0.0-20210503151800-5decd65b3731 // indirect
github.com/getlantern/framed v0.0.0-20190601192238-ceb6431eeede // indirect
github.com/getlantern/fronted v0.0.0-20230601004823-7fec719639d8 // indirect
github.com/getlantern/geo v0.0.0-20240108161311-50692a1b69a9 // indirect
github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4 // indirect
github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 // indirect
Expand Down
11 changes: 9 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ 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.78 h1:ADZ/ZJ/UoGQ6g6kGTzrecHt7P3PhOzPLRmsTc1lOzC0=
github.com/getlantern/flashlight/v7 v7.6.78/go.mod h1:GQtpdfigs9k+aoqSdxh2qTdRtAbktJSE5u1Sx3IsgW0=
github.com/getlantern/flashlight/v7 v7.6.79 h1:GAvX9yuCJ3S8qB680gFYM6D/zwmAEk9FcC+LE8hgEGQ=
github.com/getlantern/flashlight/v7 v7.6.79/go.mod h1:1zs3W2WkM5eqJ2fhEsMa8lo6hqmDW8EwokpT7TQ/MrI=
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-20230601004823-7fec719639d8 h1:r/Z/SPPIfLXDI3QA7/tE6nOfPncrqeUPDjiFjnNGP50=
Expand All @@ -292,6 +292,8 @@ github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4 h1:Ju9l1RretV
github.com/getlantern/geolookup v0.0.0-20230327091034-aebe73c6eef4/go.mod h1:4UNvIsawdB8WclVxqYv46Oe1zzWJ8wMhUO+q6tUzATo=
github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5 h1:RBKofGGMt2k6eGBwX8mky9qunjL+KnAp9JdzXjiRkRw=
github.com/getlantern/go-socks5 v0.0.0-20171114193258-79d4dd3e2db5/go.mod h1:kGHRXch95rnGLHjER/GhhFiHvfnqNz7KqWD9kGfATHY=
github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93 h1:CFLw2b6vgOmpxsRWRiTd46tiR6YKg2crIuTu4cINYcY=
github.com/getlantern/go-tun2socks v1.16.12-0.20201218023150-b68f09e5ae93/go.mod h1:wgB2BFT8ZaPKyKOQ/5dljMG/YIow+AIXyq4KBwJ5sGQ=
github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc h1:qZ/HlURAOgGRKtqDGimPwL2w5PkvW7Ap+c1bGRK0pzU=
github.com/getlantern/go-update v0.0.0-20230221120840-8d795213a8bc/go.mod h1:DQAFBxfQlSru9Loud3pLM+rF//qf0FQBtB//grF89IA=
github.com/getlantern/golog v0.0.0-20190809085441-26e09e6dd330/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc=
Expand Down Expand Up @@ -413,6 +415,8 @@ github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782 h1:A1+qM0Dqm0no8A
github.com/getlantern/rot13 v0.0.0-20220822172233-370767b2f782/go.mod h1:O0dNqH9hbXlOa9OpVdbACmTBfDPD+ENjbY0cPkzBd9g=
github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2 h1:smFR/kESUKlcdyatoOO3HngBzzrUU6S0LRw2vCBYQPg=
github.com/getlantern/rotator v0.0.0-20160829164113-013d4f8e36a2/go.mod h1:Ap+QTDJeA24+0jjPHReq/LyP3ugEEDYvncluEgsm60A=
github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627 h1:eYXtxjRyiP9f1rMvbnyT4DBWFEiIPY3zzMA5KqVshyc=
github.com/getlantern/safechannels v0.0.0-20201218194342-b4e5383e9627/go.mod h1:QJUudepmTj/KQXnReV6DZSJY/xO05fnfcZf3t8zkNLg=
github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec h1:8TfjIMydnhBs4edmXu2Nz1f2P0QOcXfol2rR1cxfrSs=
github.com/getlantern/shortcut v0.0.0-20211026183428-bf59a137fdec/go.mod h1:3VQ6qvEBehqDBNbEKfNtSjK6MR5ydOdjMPgKjKay7vo=
github.com/getlantern/sysproxy v0.0.0-20230319110552-63a8cacb7b9b h1:sn68kKTXZ6k7vyhPfYvjtoDSMufTlvvkAZ6Y+VJ25ZA=
Expand Down Expand Up @@ -862,6 +866,7 @@ github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/songgao/water v0.0.0-20190725173103-fd331bda3f4b/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E=
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8=
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down Expand Up @@ -1055,6 +1060,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200320220750-118fecf932d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand Down Expand Up @@ -1138,6 +1144,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
2 changes: 2 additions & 0 deletions internalsdk/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ func getExecutableHash() string {
// bad happening here.
if common.Platform == "android" {
return "android"
} else if common.Platform == "ios" {
return "ios"
}
if lanternPath, err := os.Executable(); err != nil {
log.Debugf("Could not get path to executable %v", err)
Expand Down
Loading

0 comments on commit 29d2280

Please sign in to comment.