Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyadavisii/d4552f04712bff947ad78a68f9a0245f to your computer and use it in GitHub Desktop.
Save anthonyadavisii/d4552f04712bff947ad78a68f9a0245f to your computer and use it in GitHub Desktop.
    There have been a few changes in the requirements needed to install Beem on Termux. I will be sharing those requirements in this guide. Additionally, will be submitting a pull request for these updates to be included in the official readme.
<img src="https://siasky.net/TADtINfAZu6sfnhPesc1WLv8JHXeBoO5iYj3IxxYHVvmfw/ZomboMeme 15012022101907.jpg">
# Repository:
https://github.com/holgern/beem
> Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device. In addition, various software can be installed through the application's package manager.
[Wiki Source](https://en.m.wikipedia.org/wiki/Termux)
&nbsp;&nbsp;&nbsp;&nbsp;During the process of troubleshooting my new install on my Samsung Galaxy Tab Lite A7, I learned that the current Google Play release of Termux is not well-maintained. When attempting to update packages, it was discovered that there are broken links to the repositories this release points.
&nbsp;&nbsp;&nbsp;&nbsp;This results in non-functional installs for Clang, Termux's C++ compiler, that, in turn results in failure to install the Python cryptography modules leveraged by Beem. It may be possible to install without said module; however, such is less than ideal as @holger80 recommends the module for the following reason:
> Signing and Verify can be fasten (200 %) by installing cryptography (you may need to replace pip3 by pip)
&nbsp;&nbsp;&nbsp;&nbsp;Fortunately, there is a version of Termux available that is better maintained on the f-droid app marketplace without this issue. Use the following steps:
<sub> Note that numbered list was not used due to being unable to use backslash escape character to continue numbering when list is interrupted on @ecency.</sub>
- Install [f-droid](https://f-droid.org). You may be asked to grant permissions to Install Unknown Apps. Grant the permission from whichever provider you desire to install the app i.e. file manager.
https://siasky.net/HAHv4aHGyrPDIUHkFrka6RDEuzZf6Bjj-afN1vVeqChwxw/Screenshot_20220115-093559_Settings.jpg
- Install Termux via the f-droid marketplace. Again, grant the permission to Install Unknown Apps
https://siasky.net/BAAoRSwGmV5n6c4sol34fSFTVvxCsStf9UrqDqBn_DkkIQ/SmartSelect_20220115-094201_F-Droid.jpg
- Now, open the Termux application and issue the first command as follows:
```
pkg install clang rust python
```
https://siasky.net/PAKxdDxJA6LNgDMIliSL5ctSnKXdgLCKmC_my9u9lD9mUA/SmartSelect_20220115-094645_Termux.jpg
Type 'Y' when prompted.
&nbsp;&nbsp;&nbsp;&nbsp;Per the [cryptography.io documentation](https://cryptography.io/en/latest/faq/#why-does-cryptography-require-rust), Rust is now a requirement for the following reason:
> ### Why does cryptography require Rust?
> cryptography uses OpenSSL (see: Use of OpenSSL) for its cryptographic operations. OpenSSL is the de facto standard for cryptographic libraries and provides high performance along with various certifications that may be relevant to developers. However, it is written in C and lacks memory safety. We want cryptography to be as secure as possible while retaining the advantages of OpenSSL, so we’ve chosen to rewrite non-cryptographic operations (such as ASN.1 parsing) in a high performance memory safe language: Rust.
In order to prevent the following error, it is necessary to determine your rust target architecture and accordingly set the CARGO_BUILD_TARGET environmental variable.
```
error: Don't know the correct rust target for system type aarch64-unknown-linux-android. Please set the CARGO_BUILD_TARGET environment variable.
```
&nbsp;&nbsp;&nbsp;&nbsp;After a bit of research, I found the correct procedure to resolve this issue via the following Github [users](https://github.com/japanese-xevvo) [bug report](https://github.com/pyca/cryptography/issues/6679).
&nbsp;&nbsp;&nbsp;&nbsp;They did take a bit of flak due to the nature of their report but, thankfully for us, that user was able to find the solution despite it. Here are the steps to set the appropriate CARGO_BUILD_TARGET:
```
rustc --print target-list
```
&nbsp;&nbsp;&nbsp;&nbsp;This will enumerate all processor / OS architectures that may be targeted. I was able to easily deduce mine based on the build messages but that isn't necessary.
- Do you know the processor type of your device?
- Do you know it's operating system?
&nbsp;&nbsp;&nbsp;&nbsp;With this information you should be able to deduce as well but, if you are having difficulty, you could just run "pip install cryptography" and then note the build messages. Example:
```
...
creating build/lib.linux-aarch64-3.10/cryptography
copying src/cryptography/__about__.py -> build/lib.linux-aarch64-3.10/cryptography
copying src/cryptography/__init__.py -> build/lib.linux-aarch64-3.10/cryptography
...
```
&nbsp;&nbsp;&nbsp;&nbsp;In my case, the appropriate target was 'aarch64-linux-android' and, so then, I was able to set the environmental variable using the following command:
```
export CARGO_BUILD_TARGET=aarch64-linux-android
```
&nbsp;&nbsp;&nbsp;&nbsp;Before attempting to install cryptography, you may want to install the wheel module. Do so with the 'pip install wheel' command. It wasn't necessary in my case but it may speed up your installation.
*Congratulations! We've made it to our last couple of steps. Now, issue the following command to install cryptography.*
```
pip install cryptography
```
Finally, we are ready to install Beem. Do so with the following command:
```
pip install beem
```
https://siasky.net/fATmIvXvT_C80_kFYGkvKkzPvuBr-N3yr4v1wBGejF9Sew/SmartSelect_20220115-101356_Termux.jpg
### Success!
https://siasky.net/fAAEx74EXE82pFp94FqFPW-nEu671Ywo42b9V2pvJTmGHw/tenor.gif
*Note: All included images in this guide are self-hosted on SiaSky, a SiaCoin Skynet powered CDN provider.*
### Let me know if you have any questions or happen to hit a snag! Glad to help!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment