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

Allow to compress the libraries #2000

Merged
merged 2 commits into from
Aug 13, 2023
Merged

Allow to compress the libraries #2000

merged 2 commits into from
Aug 13, 2023

Conversation

ale5000-git
Copy link
Member

@ale5000-git ale5000-git commented Jul 31, 2023

The current size of microG GmsCore is 76,3 MB (64,8 MB are just uncompressed libraries).
If the libraries are compressed then the total size of microG GmsCore become about 35,8 MB.

This PR change the values of useLegacyPackaging (previously know as extractNativeLibs) to allow compressing the libraries.

I was the one (on #265) suggesting to store the libraries uncompressed and it was nice at the time that the libraries was small but now they are quite big and I think now is more beneficial to have them compressed.

@CoelacanthusHex
Copy link
Contributor

But this will increase the size after installation to library size + compressed library size. Because the library must be extracted from the apk before it can be loaded.

@mar-v-in
Copy link
Member

But this will increase the size after installation to library size + compressed library size. Because the library must be extracted from the apk before it can be loaded.

Yes, but it might still be less total space used (would have to investigate) as not all libraries are extracted, but only those required for the architecture. Also download size is relevant as well, not only disk space use.

@ale5000-git
Copy link
Member Author

@CoelacanthusHex
As mar-v-in said, the total will be less on most devices since there are libraries for 4 architectures in microG GmsCore and in general just 1 architecture or maximum 2 are extracted.

@ale5000-git
Copy link
Member Author

ale5000-git commented Aug 13, 2023

I have tested it by compressing the libs in the apk with a zip compressor and the result is this:

Original file = 76,3 MB
File with compressed libs = 35,8 MB

File with compressed libs (35,8 MB) + external arm64&arm32 libs (28,6 MB) = 64,4 MB
File with compressed libs (35,8 MB) + external arm64 libs (17,2 MB) = 53 MB
File with compressed libs (35,8 MB) + external arm32 libs (11,4 MB) = 47,2 MB

File with compressed libs (35,8 MB) + external x86_64&x86 libs (36,1 MB) = 71,9 MB
File with compressed libs (35,8 MB) + external x86_64 libs (18,1 MB) = 53,9 MB
File with compressed libs (35,8 MB) + external x86 libs (17,9 MB) = 53,7 MB

It should cover most cases, obviously there may be edge cases not covered here but it is mostly smaller.

@mar-v-in mar-v-in merged commit 4651ed5 into microg:master Aug 13, 2023
1 check passed
@ale5000-git ale5000-git deleted the patch-5 branch August 13, 2023 18:55
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

Successfully merging this pull request may close these issues.

3 participants