Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App size almost doubled on 110+ releases #69

Closed
matteovaralta91 opened this issue Apr 10, 2023 · 14 comments
Closed

App size almost doubled on 110+ releases #69

matteovaralta91 opened this issue Apr 10, 2023 · 14 comments

Comments

@matteovaralta91
Copy link

matteovaralta91 commented Apr 10, 2023

Hello, thank you for your work. I noticed a little issue about releases for android after 109: the installed app size almost doubled (from 183-185 MB to 307MB). The apk files are almost still for these versions (165-168MB).

Details

image
image
image

Even the last releases have app size about 300MB.

Details

image

What did it happen between 109 and 110 releases?
NB: for these test I uninstalled uazo bromite before reinstalling, but the increased size exists also for upgraded app. I'm on Lineage, Android 13.

@uazo
Copy link
Owner

uazo commented Apr 11, 2023

Restrict use_chromium_linker only to Trichrome.
This change removes ModernLinker on developer builds such as
chrome_public_apk, which is not ideal from the ModernLinker code
coverage standpoint. Enabling ModernLinker for this set of targets
would bring a bit of code that was not exercised in a while, so
immediately it is more risky. The additional reason to use the system
linker for these APKs (and give up on RELRO sharing) is that the
ModernLinker does not work on N out of the box due to its dependence
on functions from libandroid.so that were added only in O. It should
be possible to fix, but given that we are in this 'crazy' space, it
may take a week to polish the rest of ModernLinker issues on N,O,P.

is because of Issue 1383210: Remove LegacyLinker.
so the space doubled due to the presence of the apk (170mb) and the uncompressed libchrome.so library (another 125mb).
Before, on the other hand, it loaded the library directly from the apk (crazy.libchrome.so) without having to uncompress it to disk.
nice catch.

@uazo
Copy link
Owner

uazo commented Jul 18, 2023

I found a workaround that saves about 70mb of disk space and reduces the size of the apk by the same amount.
thanks again for bringing this to my attention.

@uazo uazo transferred this issue from uazo/bromite-buildtools Jul 19, 2023
@Universalizer
Copy link

Uazo, On Latest Version 115.0.5790.98 (579009804),

My "Core installation, App size" is 324 MB, Reasons may be either of 1) Neither Rooted, 2) Nor Custom ROM, 3) Perhaps, Filesystem not properly transparent compressed or optimized.

EXCLUDING User data & Cache for BOTH Ad blockings, Internal Firewall On, & Bookmarks. (That is again additional data & size).

@uazo
Copy link
Owner

uazo commented Jul 21, 2023

Actually, the problem is the missing android:extractNativeLibs="false", which causes the native libraries to be released into the lib directory during installation, even if they are not compressed.

no, it doesn't seem to be just that. I had tried to add that setting, but the library was still extracted.

in any case, the problem is that using apks as the official release method is not supported by the chromium team, and modifying it to reactivate that feature could lead to numerous bugs that my knowledge wouldn't be able to fix.
so, for now, I am satisfied with this solution.

@uazo
Copy link
Owner

uazo commented Jul 21, 2023

This means that it may not have been added successfully,

I had checked the apk and the flag was present, but you can try it yourself, adding it to the manifest is not the solution.
I think it is because the loading of the native libraries is under some hook from the code.

any compressed native libraries will cause the installation to fail.

I had checked that too, no error.

Google actually uses this approach in its latest Chromium build type "Trichome"

yes, it is specified in the bugid I put up, as is repeatedly mentioned that the apk is not officially supported and is only left to make life easier for developers.
to reiterate, I don't want to modify parts of the code that I don't fully understand, I'd rather not get caught up in crashes (or worse security problems) that I wouldn't be able to solve. the android ecosystem is too fragmented, a solution might work for one device but not work for another.

@uazo
Copy link
Owner

uazo commented Jul 21, 2023

no, please, let's end it here :) . it's neither a goal nor a priority. maybe we can focus on something else more useful (which I would need help with)

@Universalizer
Copy link

Examples online,

https://gitlab.com/grapheneos/platform_external_vanadium/-/tree/13/prebuilt/arm64

TrichromeChrome.apk, Download size (41.15 MiB)
TrichromeLibrary.apk, Download size (137.84 MiB)

@uazo
Copy link
Owner

uazo commented Jul 21, 2023

I just want to save as much storage space as possible,

for the record, I am not telling you that you cannot go on, simply for me the matter is closed and I would not like to spend any more time on it
if you find a solution I am happy to apply it

@Universalizer
Copy link

Uazo, requesting you, a separate discussion section, if possible here.

@uazo
Copy link
Owner

uazo commented Jul 21, 2023

requesting you, a separate discussion section, if possible here.

I'm sorry but i don't understand.

@PF4Public
Copy link

requesting you, a separate discussion section, if possible here.

I'm sorry but i don't understand.

Repository settings:
image

@Universalizer
Copy link

Uazo, Thank you, For these repo's discussion here.

@Universalizer
Copy link

https://thorium.rocks/optimizations relationship to installation size ?

@Universalizer
Copy link

https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/docs/android_native_libraries.md

I want to know, in layman terms, what are pros & cons of using 1) Monochrome & 2) Trichrome library, can you simplify ? Please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants