Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 4.73 KB

BUILDING.md

File metadata and controls

78 lines (48 loc) · 4.73 KB

Building SMS Import / Export from Source

The SMS Import / Export Github repository can be cloned and the app built locally, from the command line or using Android Studio.

Note: When using Android Studio to build debug builds and deploy them to systems with API level >= 21, it may be desirable to turn off minification; see the comments in the app's build.gradle configuration file for details.

Following are instructions for building the app from the command line.

Prerequisites

There are three primary prerquisities for building the app: the Gradle Build Tool, a Java runtime environment (JRE), and the Android software development kit (SDK). (There are other dependencies as well, as specified in the dependencies {} stanza of the app's build.gradle configuration file, but they are handled automatically by Gradle.)

Gradle

The app has been designed to be built via the Gradle Wrapper script included in the repository, which will download and invoke the version of Gradle specified in the project's build.gradle configuration file. While it may be possible, and even desirable from certain perspectives, to build the app via a system Gradle installation, this has not been tested and is not supported.

JRE

To build the app, a JRE must be present and findable by Gradle; methods for arranging this vary by operating system. The app's Gradle configuration currently requires Java version 17; in Debian, just ensure that the package openjdk-17-jre-headless is installed.

Android SDK

To build the app, the Android SDK must be installed and findable by Gradle. There are various methods for arranging this, as discussed in the official Android documentation, as well as here, here, here, and here.

As with Gradle, it may be possible, and even desirable from certain perspectives, to build the app via a system SDK installation, but this has not been tested and is not supported.

Following is an example series of commands to install the SDK, largely following the official documentation:

~$ curl -O https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip
~$ unzip commandlinetools-linux-10406996_latest.zip -d ~/android_sdk
~$ mkdir ~/android_sdk/cmdline-tools/latest
~$ mv ~/android_sdk/cmdline-tools/* ~/android_sdk/cmdline-tools/latest

(Ignore the mv: cannot move ... to a subdirectory of itself ... error.)

Accept SDK Licenses

Although the Android SDK is open source, Google's packaging of the software require the acceptance of End User License Agreements (EULAs) before it can be used. The android-rebuilds project apparently used to provide rebuilt versions of the SDK without the EULAs, but the project currently does not appear to be under active development.

To accept the licenses, run:

~$ ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses

The process can be automated as follows:

~$ yes | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses

Build the App

Get the source code:

~$ git clone https://github.com/tmo1/sms-ie.git
~$ cd sms-ie

Point Gradle to the installed SDK (see here):

~$ echo "sdk.dir=/home/<user>/android_sdk" >> local.properties

Note: The full path to the SDK location must be provided - tilde expansion (~/android_sdk) will not work.

The app is now ready to be built. To build a debug build, run:

~$ ./gradlew assembleDebug

For more information, including instructions for building and signing release builds, see the official Android documentation, as well as here.