How to Build the Trustee Wallet on Android

Mar 28, 2023 | Blockchain

Creating and managing crypto accounts has never been easier, thanks to Trustee Wallet. In this guide, we will walk you through the steps to build the Trustee Wallet for Android, ensuring that you can successfully set up your environment, compile the code, and prepare your app for distribution.

Build Dependencies

Before we start building, we need to ensure that all the essential tools and dependencies are installed on your Ubuntu system. Here’s what you’ll need:

  • Build tools
  • Node.js (version 10.x)
  • OpenJDK 8

Installation Steps

Follow these commands to get everything set up:

sudo apt-get install build-essential
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs
sudo apt-get install openjdk-8-jdk
echo JAVA_HOME=$(which java) | sudo tee -a /etc/environment
source /etc/environment

System Preparation

To ensure a successful build, we need to increase the number of files that the operating system can monitor. Execute the following commands:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Next, prepare the folder and license for the Android SDK:

mkdir ~/androidsdk
export ANDROID_HOME=~/androidsdk
mkdir ~/androidsdk/licenses
echo 24333f8a63b6825ea9c5514f83c2829b004d1fee > ~/androidsdk/licenses/android-sdk-license

Building the APK

Now that we have our environment ready, let’s download the source code and build the APK:

git clone https://github.com/trustee-wallet/trusteeWallet.git
cd trusteeWallet
npm install
npx jetifier
rm -f shim.js
node_modules/.bin/rn-nodeify --hack --install
cd android
./gradlew assembleRelease

Upon successful execution, you can find the built APK file at:

.app/build/outputs/apk/release/app-release.apk

Verifying the Build

Verification is crucial to ensure that the application you distribute does not contain any hidden functions or malicious code. Here’s how you can verify the latest release:

Run the following commands:

git clone https://github.com/trustee-wallet/trusteeWallet.git
cd trusteeWallet
./docker/verify_android_build.sh

The script will compare the APK downloaded from Google Play with the APK built from the source. Differences will likely appear, but many of them are related to metadata changes from Google and do not affect functionality.

Example of Analyzing Build Differences

Here’s an example output of how the differences may look:

diff -r --brief fromBuild fromGoogle
Files fromBuild/AndroidManifest.xml and fromGoogle/AndroidManifest.xml differ

In analyzing these differences, green-marked files indicate changes that are not significant, while orange ones may require further scrutiny.

Troubleshooting

While building the Trustee Wallet, you might encounter various issues. Here are some common troubleshooting tips:

  • Build Fails: Ensure that you have installed all dependencies correctly as mentioned in the build dependencies section.
  • Permission Errors: Make sure you are using sudo when necessary, especially for commands that modify system configurations.
  • Environment Variables Not Set: If JAVA_HOME or ANDROID_HOME are not recognized, ensure you restart your terminal or source the environment file properly.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox