tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Fennec-Migration.md (7206B)


Fennec Migration

Project board: https://github.com/orgs/mozilla-mobile/projects/40

📱 Testing

⚠️ Warning: Replacing a Fennec (Firefox for Android) installation with Fenix (Firefox Preview) can (and at the time of writing this definitely will) result in DATA LOSS. Do not replace an installation of Fennec (Firefox for Android) that contains data you do not want to risk losing (e.g. open tabs, history, bookmarks, top sites, ..).

Release

The following links point to the latest Fenix (Firefox Preview) builds (Nightly; from main) that are setup to replace a Fennec (Firefox for Android) release version (org.mozilla.firefox).

Beta

The following links point to the latest Fenix (Firefox Preview) builds (Nightly; from main) that are setup to replace a Fennec Beta (Firefox for Android - Beta) release version (org.mozilla.firefox.beta).

Nightly

The following links point to the latest Fenix (Firefox Preview) builds (Nightly; from main) that are setup to replace a Fennec Nightly (Firefox for Android - Nightly) release version (org.mozilla.fennec_aurora).

📝 Changelog

The data migration work is tracked on the following project board: https://github.com/orgs/mozilla-mobile/projects/40

💻 Development

When working on migration code it is helpful to have a local Fennec build and a local Fenix build that can replace the Fennec build. The following manual setup is needed to achieve that.

In the example commands below, we assume you are replacing a Fennec Nightly build with a Fenix Nightly build.

Fennec

Download the latest version of Fennec:

- ARM64/Aarch64 devices (64 bit; Android 5+) - ARM devices (32 bit; Android 5+) - x86_64 devices (64 bit; Android 5+)

Strip out the original signature:

zip --delete fennec.apk "META-INF/*"

Re-sign the APK with your own debug key (that will also be used later for Fenix):

jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android fennec.apk androiddebugkey

You can now install this APk that is ready to be used for migration:

adb install fennec.apk

Fenix

In the app/build.gradle, add the following line in the correct scope to sign your app with the same debug key used on the Fennec APK:

android {
  buildTypes {
    fennecNightly {
      signingConfig signingConfigs.debug
    }
  }
}

Follow the build instructions in the README to get a Fenix build setup.

Now select the geckoNightlyFennecNightly build variant in Android Studio and deploy it. This build should have replaced your Fennec build now.

Sample browser

When working on migration code that lives in the Android Components repository it can be helpful to replace a local Fennec build with the sample browser (instead of Fenix). The following setup is needed for that.

Add the sharedUserId to the AndroidManifest.xml of sample browser:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:sharedUserId="org.mozilla.fennec_$USERNAME.sharedID"
    [..]

Modify the application id in build.gradle of the samples-browser module and use a versionCode that is higher than your Fennec build (2100000000 is the highest allowed version code and therefore should always work).

    defaultConfig {
        applicationId "org.mozilla.fennec_$USERNAME"
        [..]
        versionCode 2100000000

Click on "Sync Project with Gradle Files" and deploy the sample browser. This build should have replaced your Fennec build now.

Emulator snapshots

When testing migration code the following process has to be repeated multiple times:

Steps (1) to (3) can be quite time consuming. Emulator snapshots can help with that: