[Google Pixel 7 Pro] Namelesswonder:
The 32-bit apps are back!​

Watch screen-20221120-112309 | Streamable

Watch "screen-20221120-112309" on Streamable.

streamable.com

Synopsis​

The Pixel 7 line is Google's first "64-bit only" phones, along with being the highest profile release of a 64-bit only device so far. The device uses the Tensor G2 (GS201), which is a close descendant of the Tensor (GS101) from the Pixel 6 line. So close, that the only major change was swapping out the ARM Cortex-A76 cores for ARM Cortex-A78 cores. The SoC still has full 32-bit support.

This was seemingly done at the last minute to get the ball rolling on switching Android to becoming 64-bit only at some point in the future. That future might be soon for other currently supported Pixel phones as the Android 13 QPR1 Beta includes optional firmware images that are 64-bit only. Given that it is currently optional on QPR1, there is a chance that at the earliest Android 14 will be 64-bit only across all supported Pixels, with a slimmer chance that it will be 64-bit only for AOSP also.

The three items that are of importance are AArch32, what Zygote services are set to start, and whether the build supports multilib.

AArch32​

Is a mode starting with ARMv8 that provides support for the 32-bit ARM ABIs: armeabi and armeabi-v7a. An ABI is what defines how software is to be built and ran for specific instruction sets.​

AArch32 is not required to be supported with ARMv9-A architectures, which would be processors starting with ARM Cortex-X2/X3/A715. These processors support AArch64 only.​

The ARM Cortex-A510 is currently the only ARMv9-A processor that supports AArch32. This combination of processors (X2/X3/A715 with A510) results in asymmetric 32-bit support. This is the likely reason for Google expediting these changes. It is speculated that the Cortex-A520 will not support AArch32, which would put a stop to native 32-bit support completely for future devices.​

Tensor G2 cores are still on ARMv8-A and thus still support AArch32.​

​

Zygote​

Is a service that handles creating VMs for starting applications, and is responsible for allowing resources to be shared to reduce memory bloat from duplication. There are two Zygote services, Zygote64 and Zygote (colloquially referred to as Zygote32). Each handle a "warm" VM that is preloaded with libraries, which gets cloned for starting an application. This is done via copy-on-write, which means a copy is only made and occupies memory when attempting to modify a resource. The untouched copies all point back to the original, saving memory.​

Without Zygote32, 32-bit applications can't be started. Without Zygote64, 64-bit applications can't be started.​

Having multiple Zygote processes is referred to as "Zygote64_32"​

​

Multilib​

Is a scheme that allows for 32-bit and 64-bit libraries to reside on the same device. This is required to support running 32-bit applications on 64-bit devices. Android has it's own implementation that differs from most Linux distributions, which may also differ between each other.​

Obviously, without 32-bit libraries (or inversely without 64-bit libraries), a build does not support multilib.​

​

Somewhat important to note is that the 64-bit only QPR Beta images for the Pixel 4a to 6 are true 64-bit only, they do not support multilib. However, as noted here by Google, the Pixel 7 is 64-bit only but does support multilib.

The support matrix is as follows:

Phone + SoC, Build​

SoC AArch32 Support​

Zygote Property​

Multilib​

32-bit Support?​

Pixel 6 with Tensor​

Yes​

Zygote64_32​

Yes​

Native​

Pixel 6 with Tensor, 64-bit Only Build​

Yes​

Zygote64​

No​

Not Possible*​

Pixel 7 with Tensor G2​

Yes​

Zygote64​

Yes​

With Modification​

Pixel 7 with Tensor G2, 64-bit Only Build**​

Yes​

Zygote64​

No​

Not Possible*​

Phone with AArch64-only ARMv9-A​

No​

Zygote64​

No​

Not Possible***​

* If no multilib build is also available. It may be possible with extensive work to use Treble to bring 32-bit libraries forward, assuming Android 14+ doesn't remove AArch32 and Zygote32. Emulation could be a possibility but has not been done yet.​

** Build does not exist yet. It may be realized with a QPR build or it may be done with Android 14 instead.​

*** Emulation could be a possibility but has not been done yet. Currently just the Pixel 6 and 7 have KVM built-in, but the Pixel 7 is the only one with it on by default.​

This means that with the right changes 32-bit support can be enabled and used if 32-bit libraries are on the device and the SoC supports AArch32.

Modifications​

The changes required are as follows:

ro.zygote=zygote64_32​

ro.vendor.product.cpu.abilist=arm64-v8a,armeabi-v7a,armeabi​

ro.vendor.product.cpu.abilist32=armeabi-v7a,armeabi​

​

Genuinely that simple, property changes. Because the libraries are already in the firmware images it is just the need to instruct Android to use them.

Zygote64_32 refers to starting Zygote64 as the primary process, then starting Zygote32 as the secondary process. With this in place 32-bit applications can be installed and ran as 32-bit libraries are now able to be loaded.

The changes that need to be done are to either be applied to /vendor/build.prop, or done with init.rc modifications, or applied in some way before init.rc is read.

The last point is the critical issue that has halted this: there has not been any easy way to set properties very early in the boot process outside of simply just modifying the file on the partition.

This can't be done easily due to dynamic partitions requiring a custom super partition, and with the larger issue being AVB.

Luckily we can patch Magisk to do these changed early enough in the boot process.

Forewarning​

A wipe is required​

I do not know exactly why, but when a device is first booted with only Zygote64 it can't be switched over to use Zygote64_32. For some reason the 32-bit libraries inside APEXs are not discovered and loaded by Zygote32.

Support for custom ROMs is not guaranteed​

It may or may not work. As a matter of fact, doing this modification isn't necessary as custom ROMs could implement this change themselves.

It is known that the modification does work on LineageOS.

I have not tested all 32-bit applications​

I don't actually use any 32-bit apps. I have done testing with a few 32-bit apps I've gotten from APKMirror. So no, I don't know if your Instagram mod is working. I don't see any reason why it wouldn't.

Download Links​

Spoiler content hidden.

Installation Instructions​

General Prerequisites:​

A working platform-tools environment

platform-tools 33.0.3 is required with the Pixel 7​

The version you are running can be checked with adb --version and fastboot --version​

If you need assistance then read this thread by @roirraW "edor" ehT.​

Tools like PixelFlasher can be used, just read into how to use it.​

​

The factory image for the firmware version you are running or plan to run

Part of the steps are requires the firmware for your phone, you can download it from here..​

Copy init_boot.img out from image-xxx.zip inside the firmware archive.​

Backup your data

A wipe is required.​

​

With my Magisk Zygote64_32 fork (Recommended)​

Spoiler content hidden.

​

With my Magisk Delta 32-bit fork (Not Recommended For General Use, Advanced Users Only)​

Spoiler content hidden.

System Upgrade Instructions (Post Mod Installation)​

Spoiler content hidden.

Magisk Upgrade Instructions​

Spoiler content hidden.

Changing Between My Magisk Forks​

Spoiler content hidden.

Uninstallation Instructions​

Spoiler content hidden.

Troubleshooting​

Stuck at boot animation or bootlooping​

Restore stock init_boot.​

Grab a logcat with adb to determine what the problem may be.​

You might not have wiped your device.​

​

Booted after installing new Android update but forgot to flash Magisk​

Run through the installation instructions again, you will have to wipe your device.​

​

Unable to install 32-bit apps​

Run getprop ro.zygote; getprop ro.vendor.product.cpu.abilist; getprop ro.vendor.product.cpu.abilist32​

If the values do not match these then the modification was not applied.​

zygote64_32​

arm64-v8a,armeabi-v7a,armeabi​

armeabi-v7a,armeabi​

​

32-bit apps force close​

This only happened in my testing when I did a first boot with Zygote64 and then installed the modification to use Zygote64_32. Wipe your device or perform the wipeless installation instructions.​

It is possible the app may just have issues, or will not work because of missing libraries.​

​

Clobbered the persist partition​

Follow the uninstall steps for Magisk Delta, easiest to use the fastboot steps.​

If you didn't backup your persist partition, then RIP.​

Questions​

Will I have to wipe on every system update?​

I'm glad to say no.​

I've tested with my Magisk Delta 32-bit, going from October -> November, while keeping Zygisk/MagiskHide enabled along with the Magisk app being hidden.​

I also tested December -> January with my Magisk Zygote64_32 and even swapping to my Magisk Delta 32-bit in the process without issue.​

​

Can I take OTAs instead of flashing factory images?​

I would heavily recommend against doing so, however I have done Android 14 Beta 1 to Beta 1.1 on device and it works.​

I booted with the patch, but then accidentally flashed over init_boot without changing to a different build version, what do I do?​

Simply just flash the patched Magisk image back over. I've tested it, 32-bit applications are still kept, and I haven't encountered any issues once I flashed the patched Magisk image back onto it.​

​

If this was because of an update then follow the installation instructions, you will have to wipe your device.​

Will my persist partition be destroyed?​

You shouldn't have to worry about that, a backup persist image will be able to completely restore it. Just don't install modules that will attempt to install more than 32MB of data to the earlymount.d folder.​

Thanks To​

Thomas King for Pixel 7 32-bit Helper​

@huskydg for Magisk Delta and letting me know about the Zygisk implementation maru​

5ec1cff for maru​

@nickelnine for bringing attention to Pixel 7 32-bit Helper​

Posters in the thread for helping me debug the issues that have come up.​