trichromelibrary squoosh

This module is meant to “squoosh” (remove or compress) old TrichromeLibrary packages that build up on your device and take up space.

Description

Google added TrichromeLibrary to Android Q (Android 10) and later systems. This library is a way to save space on your device by making it more efficient. It does this by having the same core code in both the Google Chrome browser and the system’s WebView. This stops code from being duplicated.

When you install or update Chrome or WebView (which happens automatically through the Play Store), the system correctly downloads and installs the right version of TrichromeLibrary to go with it.

But there is a big mistake in this process: the Play Store does not always uninstall the old, outdated versions of the library. Over time, as you get more updates for Chrome and WebView, these old libraries build up, taking up a lot of space—exactly what the library was supposed to do in the first place.

The Technical Challenge

Cleaning these old libraries by hand is hard. To get rid of one, use the command “pm uninstall com.google.android.trichromelibrary_$version.” The hard part is finding the exact $version of the old packages.

This is difficult for two main reasons:

TrichromeLibrary dirs

The Modern Solution

Because of feedback from the community (specifically issue#1), TrichromeLibrary-Squoosh now uses a better method that does not require root privileges.

The command “dumpsys package|grep name:c” is now used in the script. To successfully list all installed versions of TrichromeLibrary, this command only needs basic “shell privileges,” which Magisk or ADB can give.

The script then automates the cleanup logic:

  1. It asks the system for a list of all the com.google.android.trichromelibrary packages that are already installed.
  2. It sorts the list that comes out to find the one newest version, which is the one that is being used right now.
  3. It goes through all the other versions it finds and runs the “pm uninstall” command on each outdated package in a systematic way.

This process makes sure that only the library that is currently needed stays, and all of the older versions that take up space are deleted.

Usage

Depending on how your device is set up, you can use this script in two ways.

This is the “set-it-and-forget-it” solution that runs automatically for people who have Magisk, KSU, APatch, or KSU Next.

After installation, the script will run on its own every time your device restarts. This will make sure that any new, old libraries are removed after system updates.

2. Manual Execution (via ADB Shell)

You can still clean up your device once using ADB from your computer if you don’t have Magisk or a similar tool.

This command gets the script’s content straight from the GitHub repository and runs it in your device’s shell, which does the cleanup. Please note that you will have to run this command again by hand in the future to clean up again.

Download Link

Module Info

Search on : Google Bing Yandex