In the article that opened the section, I was asked to tell about the application Facebook. Therefore, in the first issue of the column, it will be discussed. And, of course, speaking of Facebook, one cannot but consider its main competitors here – VKontakte and Odnoklassniki.
The application takes up almost 70 megabytes. The main problem for analysis is obfuscation. Information found on the net (about the correct structure of the packet and about some other internals) can help in part. Of course, I would like to get full deobfuscation, but just don't do it like that (for example, the deguard deobfuscator only works with packets up to 16 MB). However, since we are not interested in subtleties, and we only want to get an estimate in general, even an analysis of an obfuscated packet can provide basic information. So, the main 'megabyte eaters':
- The application itself + java libraries – 26.1 Mb;
- A set of JavaScript scripts (obfuscated by Fb4aBundle.js) – 19 MB:
- Binary libraries – 8.9 MB;
- Localization files – about 13 MB;
- Graphics – about 5 MB.
In contact with
Here, unlike Facebook, everything is much simpler. The application is not obfuscated, so you can safely watch where the entire 31 megabyte of the package is being spent.
This volume is mainly accounted for by the following components:
- Binary libraries – 15.6 MB (of which 9.7 MB – its own library and 4.8 MB – ffmpeg – a standard library for working with video).
- Emoji – 6.4 MB (stored separately from standard graphics in several sizes);
- Fonts – 485 Kb;
- Graphics for different pixel densities – about 6 MB (there are different images here, from icons to banners);
- The actual application + Java libraries – 6.6MB.
As a result, VK has nothing particularly criminal. Although it would be quite possible to save a few megabytes on images (emoji, banners, etc.).
Classmates
The application takes about the same as VK – 33.5 MB.
Therefore, it will be interesting to compare these two applications. So what's under the hood here:
- Graphics – over 10 MB (including emoji and banners, which are approximately 4.3 MB);
- Binary libraries – 5.3 MB (including libraries for working with video – 4 MB);
- Application + Java libraries – 22.8 MB;
As in the case of VK, it would be possible to reduce the volume of the application at the expense of graphics. But the Odnoklassniki app itself is not built optimally. For example, here two libraries are used at once for asynchronous work – Reactive (RxJava) and Bolts.
LiveJournal, or not everything is so bad
One might get the impression that absolutely all social media apps are poorly written out of the box. But this is not the case. Take LiveJournal for example. Of course, this is not a social network, but rather blogs with elements of a social network, but to illustrate the optimality of the size of the LJ application, it is quite possible to consider.
As you can see, there is only one .dex file, which indicates the small size of the application itself and the Java libraries. But what's even more interesting is the approach to graphics. There are no bulky banners for hundreds of kilobytes. Moreover, the graphics are made for a pixel density of no more than 480 dpi.
This means that on devices with software pixel density (for more details, see the article 'Why large devices are really small') 640 dpi (for example, LG G3 / G4) everything will not be as beautiful as possible, but we managed to save quite a lot on the amount of graphic files.
What's next?
Write in the comments which applications you would like to know more about.