Amanieu Systems - Tango restores v7 32bit support to v8 64bit only devices.

Trusted by over 1.6 million members since 2014 — why not join them?
Log in or Register to join us!

Snailsoft

∞ and beyond!
Staff Member
Moderator
✔ Approved Releaser
Active User
Member for 2 years
Chinese made devices include Tango by default. After 2 years of Google ignoring pleas to restore v7 32bit support, Amanieu Systems released this trial version that will run for 4 hours at a time.
It is not a simple install however and much research should be done before attempting this.
For Android 12-15
This is not an Android on Android emulator. This is a code interpreter.


========
Overview
========

Tango is a binary translation system for GNU/Linux and Android which allows
unmodified 32-bit ARM programs to run on 64-bit only ARM processors. Tango uses
a combination of run-time dynamic translation and ahead-of-time pre-translation
to achieve high performance in translated code.

This package contains an example integration for different versions of Android
with the Pixel 6 phone as a reference device.

The integration consists of the following functionality:
- Automatic translation of all 32-bit processes on a device. This is done by
registering a binfmt_misc handler early in the boot process.
- Build-time pre-translation of 32-bit libraries and binaries in the Android
read-only system and vendor partitions.
- On-device pre-translation of applications when they are installed, or during
background optimization when the device is idle.

Pre-translation is an optimization: Tango will function correctly without it,
but its absence will impact application load times and latency, as well as
memory usage.

============
Installation
============

Integrating Tango into Android requires several patches to the AOSP source tree.
The patches are split into 3 parts: the core Tango patches are mandatory, while
the patches for build-time pre-translation and on-device pre-translation are
optional.

Copy the tango-core/vendor/amanieu directory into your Android source tree. Then
apply the remaining patches to their respective directory in your Android source
tree.

A helper script is provided to apply all of the patches:
./apply_aosp_patches.sh android-14/tango-core $AOSP
./apply_aosp_patches.sh android-14/build-time-pretranslation $AOSP
./apply_aosp_patches.sh android-14/on-device-pretranslation $AOSP

The patches under device/google show the reference integration for a Pixel 6
(oriole) phone. These can be adapted for use on other devices.

=============
Kernel module
=============

Tango uses a kernel module to support emulating certain 32-bit system calls.
The source code of the kernel module is in the kernel-module directory. It
requires a minimum kernel version of v5.6.

The module will create a device file at /dev/tango32 which must be made
available to all translated processes.

The kernel symbols used by this module are included in the KMI symbol list for
the Android 5.15 and later Android Common Kernels. On earlier kernel versions
you may need to disable KMI for the module to work.

==================
Build-time options
==================

The following options can be specified when including tango.mk:

WITH_TANGO = true
General control for Tango. If this is false then Tango is not included on
the device.

Build-time pre-translation
--------------------------

These settings control build-time pre-translation of files included in one of
the system images (e.g. /system, /vendor, /apex).

These require the build-time pre-translation AOSP patches to be applied to have
any effect.

TANGO_PRETRANSLATE = true
Controls whether Tango pre-translation is performed at build-time. If this
is disabled then the options below will have no effect.

TANGO_PRETRANSLATE_ODEX = true
Pre-translate .odex files generated by dex2oat from packages and Java libs.

TANGO_PRETRANSLATE_BINARY = true
Pre-translate ELF executables and shared libraries.

TANGO_PRETRANSLATE_APK = true
Pre-translate ELF shared libraries that are embedded in APKs and are
memory-mapped directly from APKs without needing to be extracted.

On-device pre-translation
-------------------------

These settings control on-device pre-translation of native libraries included
in installed applications. Their only effect is to set initial values for
Android system properties which control on-device pre-translation (see below).

These require the on-device pre-translation AOSP patches to be applied to have
any effect.

TANGO_PRETRANSLATE_ON_DEVICE = true
General control for on-device pre-translation. If this is disabled then the
options below will have no effect.

TANGO_PRETRANSLATE_ON_DEVICE_ODEX = true
Pre-translate .odex files generated by dex2oat for installed applications.

TANGO_PRETRANSLATE_ON_DEVICE_BINARY = true
Pre-translate native libraries included in applications.

TANGO_PRETRANSLATE_ON_DEVICE_APK = true
Pre-translate ELF shared libraries that are embedded in APKs and are
memory-mapped directly from APKs without needing to be extracted.

TANGO_PRETRANS_ON_INSTALL = true
Controls the default value of the tango.pretrans_on_install property. This
controls whether to pre-translate all libraries and APKs as soon as a
package is installed. If this is disabled then pre-translation is only done
when the device is idle, as part of the background dexopt service.
Pre-translation can also be forced by running the following command:
"cmd package compile -m space <com.example.package>"

===========================
System properties for Tango
===========================

These options are only read on process startup. Translated programs must be
restarted for any property changes to take effect. The easiest way to do this is
to kill all translated processes running under Tango using this command:
- adb shell 'for x in /proc/*/exe; do if [[ "$(readlink $x)" = */tango_translator* ]]; then echo $(basename $(dirname $x)); fi; done | xargs kill -9'

tango.enabled = 1
Globally enables or disables Tango for all 32-bit processes. Note that this
property only accepts the values "0" and "1", other values are ignored.

tango.use_pretrans = true
Whether tango_translator should load pre-translated .tango files. This is
mainly used as a debugging option to debug issues with pre-translation.

tango.debug = "info" (userdebug/eng) "off" (user)
Controls the log level of the Tango translator, which is output to the
Android logd and to the log files in /data/tango.

tango.log_dir = "/data/tango/log" (userdebug/eng) "" (user)
Directory in which tango_translator will write debug log files. You need
to disable SELinux with "setenforce 0" to allow application processes to
write log files.

===========================================
System properties for Tango pre-translation
===========================================

tango.pretrans.debug = "info" (userdebug/eng) "off" (user)
Controls the log level of the Tango pre-translator, which is output to the
Android logd and to the log files in /data/tango.

tango.pretrans.log_dir = "/data/tango/pretrans_log" (userdebug/eng) "" (user)
Directory in which tango_pretranslator will write debug log files. You may
need to disable SELinux with "setenforce 0" to allow application processes
to write logs.

tango.pretrans_on_install = true
Controls whether to pre-translate all libraries and APKs as soon as a
package is installed. If this is disabled then pre-translation is only done
when the device is idle, as part of the background dexopt service.
Pre-translation can also be forced by running the following command:
"cmd package compile -m space <com.example.package>"

tango.pretrans.odex = true
Pre-translate .odex files generated by dex2oat from installed packages.

tango.pretrans.apk = true
Pre-translate ELF shared libraries that are embedded in APKs and are
memory-mapped directly from APKs without needing to be extracted.

tango.pretrans.lib = true
Pre-translate ELF shared libraries extracted from installed packages.

tango.pretrans.max_size = 67108864
Limits pre-translation to binaries smaller than the given size to avoid
spending excessive time on pre-translation.
 
The Cursed Castle - Online RPG on Google Play
Top