[Not proper] Install OpenGapps in atvXperience TWRP

Post your great articles here :)
Post Reply
User avatar
SrWladimir
Verified Member
Posts: 44
Joined: Fri Feb 01, 2019 9:44 pm
Has thanked: 15 times
Been thanked: 3 times

[Not proper] Install OpenGapps in atvXperience TWRP

#1

Post by SrWladimir » Fri Feb 01, 2019 11:07 pm

WARNING: YOU ARE ALREADY GOOD WITH atvXperience DEFAULT GAPPS, ONLY TRY THIS IF YOU LIKE TO MESS WITH YOUR DEVICE
Warning 2: This tutorial will asume that you know how to use Amlogic Tools and you know how to edit a file, this is just a dirty hack and only try this at your risk

Why this happen?
atvXperience firmware (or the firmware that atvx is based on) has an issue that in TWRP if you try to install OpenGapps(TVSTOCK) you will receive various errors like:
1. "This package is for 7.1.x" even if you have 7.1.2
2. "There is not space in the system" even having space for it.

1.) Happens because of the "default.prop" recovery image that for some reason has android version 5.1.1 and sdk 22 in the settings and OpenGapps uses this data for detecting version, easily fixable for the atvxperience team

2.) This happens because TWRP (or the entire firmware) has a bad setup of project treble: causing the OpenGapps fail to calculate the size and space left of the system: (I don't how to fix this on the firmware)
How Opengapps should display the size calculation in the log:

Code: Select all

         Total System Size (KB) | 2049200
         Used System Space (KB) | 940488
         Current Free Space (KB) | 1092328
What you get:

Code: Select all

         Total System Size (KB) | Filesystem
         Used System Space (KB) | 1K-blocks
         Current Free Space (KB) | Used
         Additional Space Required (KB) | 42844
If you for some reason want to install OpenGapps anyway, here is my work-around:

Requirements
- Windows PC
- A text editor that is not the in-built notepad in windows (notepad++ or sublime text)
- AmlogicTool (Customization tool)
- Basic knowledge of using AmlogicTools
- Patience

How-to:
Wrong android version bug
- Unpack atvXperience IMG in level 2 mode
- Go to the "Kernel/Recovery" tab and click "Open recovery directory"
- Search for the "default.prop" file and open it with a text editor
- Look for these two settings:

Code: Select all

ro.build.version.sdk
ro.build.version.release
And make it look like this:

Code: Select all

ro.build.version.sdk=25
ro.build.version.release=7.1.2
(You can put another android version, just be sure to put the android version of you atvXperience build and his matching sdk)
- Save it
- Repack recovery and flash it in the way you like (if you will select only recovery mode in packaging, when you flash it uncheck any erase setting)
- Flash it
- Done, if the other error appears follow the next steps
Insufficient system space
- Download the latest Opengapps-tvstock package
- Extract "installer.sh" from the OpenGapps zip file
- Open "installer.sh" it with a text editor
- Search for this:

Code: Select all

if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
then
  device_abpartition=true
  SYSTEM=/system/system
  VENDOR=/vendor/vendor
else
  device_abpartition=false
  SYSTEM=/system
  VENDOR=/vendor
fi
And replace it with this:

Code: Select all

if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
then
  device_abpartition=false
  SYSTEM=/system
  VENDOR=/vendor
else
  device_abpartition=false
  SYSTEM=/system
  VENDOR=/vendor
fi
- Save it
- Put the "Installer.sh" file back into the Opengapps.zip
- Flash it with TWRP
- Done

If you still have the error of insufficient system space, try resizing the system partition in TWRP.
If nothing of what I write worked, there is nothing I can do for it.

Hope this helped in any way.
Last edited by SrWladimir on Mon Apr 22, 2019 11:19 pm, edited 4 times in total.

This topic has 10 replies

You must be a registered member and logged in to view the replies in this topic.


Register Login
 
Post Reply