Skip to content

Commit

Permalink
Ios readme (#940)
Browse files Browse the repository at this point in the history
* IOS info.

* Added ios release info.

* Update README.md

* Added note for Apple m1
  • Loading branch information
jigar-f authored Nov 5, 2023
1 parent 3df5757 commit 960fb3e
Showing 1 changed file with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lantern Android [![Go Actions Status](https://github.com/getlantern/android-lantern/actions/workflows/go.yml/badge.svg)](https://github.com/getlantern/android-lantern/actions) [![Coverage Status](https://coveralls.io/repos/github/getlantern/android-lantern/badge.svg?t=C4SaZX)](https://coveralls.io/github/getlantern/android-lantern)
# Lantern App [![Go Actions Status](https://github.com/getlantern/android-lantern/actions/workflows/go.yml/badge.svg)](https://github.com/getlantern/android-lantern/actions) [![Coverage Status](https://coveralls.io/repos/github/getlantern/android-lantern/badge.svg?t=C4SaZX)](https://coveralls.io/github/getlantern/android-lantern)

Lantern Android is an app that uses the [VpnService](https://developer.android.com/reference/android/net/VpnService) API to intercept and reroute all device traffic to the Lantern circumvention tool.
Lantern APP is an app that uses the [VpnService](https://developer.android.com/reference/android/net/VpnService) API to intercept and reroute all device traffic to the Lantern circumvention tool.

## Feature: Replica Mobile

Expand Down Expand Up @@ -30,6 +30,7 @@ All those dependencies must be in your PATH

* Java 11 or greater
* [Android Studio](https://developer.android.com/studio)
* [Xcode](https://developer.apple.com/xcode/resources/)
* [Git](https://git-scm.com/downloads)
* [Android NDK](#steps-to-run-the-project)
* NDK should be version 26.x, for example 26.0.10792818.
Expand All @@ -44,12 +45,10 @@ All those dependencies must be in your PATH
* CMake 3.22.1
* You can get this from Android SDK Manager

In the welcome screen choose the "Open an existing Android Studio" option and select the `android` folder.

Do this the first time your run the project:
### πŸš€ Setup Project:

* Install all prerequisites
* You'll need the liblantern-all.aar containing the Go backend code in order for the project to compile. Build it with `make android-lib ANDROID_ARCH=all` (see "Building the InternalSdk" section below for more info)
* Run `git submodule update --init --recursive`
* Run `git lfs install && git pull`
* Go to the **SDK MANAGER**
Expand All @@ -68,13 +67,27 @@ Do this the first time your run the project:
- Google Play Services
- Intel x86 Emulator Accelerator (HAXM installer)
* Click on Apply and accept the Terms and Conditions.
* If you are opening Xcode first time open Xcode and install necessary components
* Lastly `Flutter Doctor` to confirm that your setup is correct and ready!

### Running the project
### πŸ€– Running the project on Android

* `make android-lib ANDROID_ARCH` (you need to generated liblantern-all.aar containing the Go backend code in order for the project to compile.)
* `flutter pub get`
* `flutter run --flavor prod`

Or, run it from Android Studio if you're using that.

### 🍏 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.)
* `flutter pub get`
* `flutter run --flavor prod`

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

### πŸ‘©β€πŸ’» Using Android Studio? No problem!

We've got you covered! If you prefer using Android Studio, we have already set up the configuration files for you. Just select the prod configuration and hit Run... Get ready to start digging! πŸ˜„πŸ”

You can build an emulator with `./scripts/run_avd.rb`. Here's an example run: `./scripts/run_avd.rb --level=30 --abi=x86 --use_google_apis --window`.
You'll need Ruby >= 2.3 installed and `colorize` gem (i.e., `gem install colorize`).
Expand All @@ -89,16 +102,24 @@ A sane terminal command (using [pidcat](https://github.com/JakeWharton/pidcat))

### 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 an AAR file that lives in `./android/app/libs` and is called `liblantern-ARCH.aar`.
It is compiled from Go using [Gomobile](https://github.com/golang/mobile) to an AAR file that

#### Android
For compiled code lives in `./android/app/libs` and is called `liblantern-ARCH.aar`.

Package the AAR with `make android-lib ANDROID_ARCH=all`

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


#### Testing against Lantern's staging servers

Package the AAR with `make android-lib ANDROID_ARCH=all STAGING=true`

### Making debug builds
### Making Android debug builds (Not yet implemented on IOS)

To create a debug build of the full lantern mobile app:

Expand All @@ -118,7 +139,8 @@ or
make android-release-install
```

### Making staging builds
### 🚧 Making Staging Builds


To build mobile for staging, use the STAGING command line argument:

Expand All @@ -128,8 +150,23 @@ STAGING=true make android-debug android-install

This will build Flashlight with the same [STAGING flag](https://github.com/getlantern/flashlight/v7/blob/9eb8abbe036e86b9e72a1a938f29e59f75391676/common/const.go#L43), which allows your client to use the [staging pro-server](https://github.com/getlantern/pro-server-neu/blob/fa2859edf213998e15cd7c00461e52fd97a9e570/README.md#L125) instance instead of the production one.

### Making release builds
### πŸŽ‰ Making Release Builds

#### IOS

Do this to make a release build:
```
VERSION=x.x.x make ios-release
```
**Note**: Replace x.x.x with the version number of your release.

This will
- Set the version number in the info.plist file and increment the build number 1
- Upload the DSYM file to Sentry
- Open the build folder once the build is complete


#### Android
The Android app is distributed in two ways, as an APK for side-loaded installation and as an app bundle (aab) for distribution on the Google Play Store. The APKs are architecture specific whereas the app bundle contains all 4 architectures (arm and x86 in 32-bit and 64-bit variants).

Do this to make a release build:
Expand Down

0 comments on commit 960fb3e

Please sign in to comment.